Android Studio升級4.1.1后各種錯(cuò)誤和解決方案
1,CMake Error: CMake was unable to find a build program corresponding to “Ninja“.
因?yàn)轫?xiàng)目中使用到Cmake編譯的C/C++代碼,升級了Android Studio后編譯出現(xiàn)CMake Error: CMake was unable to find a build program corresponding to “Ninja”.CMAKE_MAKE_PROGRAM is not set.
執(zhí)行編譯查看編譯詳細(xì)報(bào)錯(cuò)信息
gradlew :emsinglerecord:assembleDebug --stacktrace --info
最終更換了CMAKE的環(huán)境變量(電腦=>屬性=>高級系統(tǒng)設(shè)置=>環(huán)境變量=>Path里修改了原來的cmake路徑為最新的D:\VS\cmake\3.10.2.4988404\bin);并且在SDK Manager里下載了最新的NDK,在Project Structure=>SDK Location里更新Andoid NDK location為D:\VS\ndk\21.3.6528147后這個(gè)錯(cuò)誤消失。
2,編譯時(shí),Build窗口報(bào)錯(cuò)信息里顯示亂碼(中文顯示亂碼)
因?yàn)檫@個(gè)是亂碼看不到具體的報(bào)錯(cuò)原因,所以需要解決這個(gè)問題。
點(diǎn)擊Help => Edit Custom VM options…,然后在創(chuàng)建的文件或者已經(jīng)有的studio64.exe.vmoptions文件里添加-Dfile.encoding=UTF-8
重啟Android studio該問題解決
3,編寫代碼無錯(cuò)誤提示(警告、報(bào)紅等)
Android ButterKnife Zelezny插件導(dǎo)致的,在Settings=>Plugins里卸載掉后重啟Android Studio正常
4,Plugin Error: Plugin “simpleUML” is incompatible (supported only in IntelliJ IDEA)
插件不兼容,在C:\Users\Administrator\AppData\Roaming\Google\AndroidStudio4.1\plugins中刪除"simpleUML"插件,重新打開后OK。
5,error: resource android:attr/dialogCornerRadius not found.
資源找不到
修改compileSdkVersion 28 , targetSdkVersion 28后編譯OK。
6,類似這樣的報(bào)錯(cuò):Could not find method apt() for arguments [org.androidannotations:androidannotations:3.3.2]
1,build.gradle里注釋掉所有的android-apt:
// classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' // apply plugin: 'com.neenbedankt.android-apt'
2,修改apt為
// apt 'org.androidannotations:androidannotations:3.3.2' annotationProcessor 'org.androidannotations:androidannotations:3.3.2'
然后又會(huì)出現(xiàn)下面錯(cuò)誤
7,錯(cuò)誤: Could not find the AndroidManifest.xml file, going up from path [D:\Work\WorkSpace\AndroidVideo…
build.gradle里添加如下:
defaultConfig { applicationId 'com.danikula.videocache.sample' minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName '1.0' javaCompileOptions { annotationProcessorOptions { arguments = [ 'resourcePackageName': android.defaultConfig.applicationId, "androidManifestFile": "$projectDir/src/main/AndroidManifest.xml".toString() //主要是這一行,告訴androidManifestFile的位置 ] } } }
目前就遇到這些,等遇到新的再添加。
到此這篇關(guān)于Android Studio升級4.1.1后各種錯(cuò)誤和解決方案的文章就介紹到這了,更多相關(guān)Android Studio升級4.1.1內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
百度地圖API提示230 錯(cuò)誤app scode碼校驗(yàn)失敗的解決辦法
筆者近2天在 Android Studio上玩了一下百度地圖,碰到了常見的"230錯(cuò)誤 APP Scode校驗(yàn)失敗",下面我來介紹一下具體的解決辦法2016-01-01android實(shí)現(xiàn)自動(dòng)發(fā)送郵件
這篇文章主要為大家詳細(xì)介紹了android實(shí)現(xiàn)自動(dòng)發(fā)送郵件,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2018-07-07自己實(shí)現(xiàn)Android View布局流程
這篇文章主要介紹了自己實(shí)現(xiàn)Android View布局流程,幫助大家更好的理解和學(xué)習(xí)使用Android,感興趣的朋友可以了解下2021-03-03Android圖像切換器imageSwitcher的實(shí)例應(yīng)用
這篇文章主要為大家詳細(xì)介紹了Android圖像切換器imageSwitcher的實(shí)例應(yīng)用,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2020-10-10Android Activity中onStart()和onResume()的區(qū)別分析
這篇文章主要介紹了Android Activity中onStart()和onResume()的區(qū)別,結(jié)合Activity的四種狀態(tài)簡單分析了Android Activity中onStart()和onResume()方法的作用,并補(bǔ)充說明了Activity中六個(gè)常用函數(shù),需要的朋友可以參考下2016-01-01Android實(shí)現(xiàn)數(shù)字跳動(dòng)效果的TextView方法示例
數(shù)字跳動(dòng)效果相信大家應(yīng)該都見過,在開發(fā)加上這種效果后會(huì)讓ui交互看起來非常不錯(cuò),所以下面這篇文章主要給大家介紹了Android實(shí)現(xiàn)數(shù)字跳動(dòng)的TextView的相關(guān)資料,文中給出了詳細(xì)的示例代碼,需要的朋友可以參考學(xué)習(xí),下面來一起看看吧。2017-04-04