Android Studio升級(jí)4.1.1后各種錯(cuò)誤和解決方案
因?yàn)轫?xiàng)目中使用到Cmake編譯的C/C++代碼,升級(jí)了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)境變量(電腦=>屬性=>高級(jí)系統(tǒng)設(shè)置=>環(huán)境變量=>Path里修改了原來的cmake路徑為最新的D:VScmake3.10.2.4988404bin);并且在SDK Manager里下載了最新的NDK,在Project Structure=>SDK Location里更新Andoid NDK location為D:VSndk21.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:UsersAdministratorAppDataRoamingGoogleAndroidStudio4.1plugins中刪除'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:WorkWorkSpaceAndroidVideo…
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升級(jí)4.1.1后各種錯(cuò)誤和解決方案的文章就介紹到這了,更多相關(guān)Android Studio升級(jí)4.1.1內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. 阿里前端開發(fā)中的規(guī)范要求2. 低版本IE正常運(yùn)行HTML5+CSS3網(wǎng)站的3種解決方案3. XML入門精解之結(jié)構(gòu)與語法4. css進(jìn)階學(xué)習(xí) 選擇符5. XML入門的常見問題(一)6. PHP字符串前后字符或空格刪除方法介紹7. html小技巧之td,div標(biāo)簽里內(nèi)容不換行8. 詳解PHP實(shí)現(xiàn)HTTP服務(wù)器過程9. 概述IE和SQL2k開發(fā)一個(gè)XML聊天程序10. Echarts通過dataset數(shù)據(jù)集實(shí)現(xiàn)創(chuàng)建單軸散點(diǎn)圖
