1. 程式人生 > >android studio bug : aidl is missing 解決方案

android studio bug : aidl is missing 解決方案

visio ogr example tin .html using 項目 tac users

很久不打開Android studio 今天打開一下,發現之前配置好的開發環境不能用了!

項目中“R.”變紅了,運行結果如下,可以說很怪,電腦沒動過,怎麽回事呢?

技術分享圖片

於是StackOverflow一下:

找到一段可能有用的話:

“This bug happens when the versions of SDK, Build Tools and Gradle Plugins doesn‘t match (in terms of compatibility). The solution is to verify whether you are using the latest version of them or not. The gradle plugins are placed in the build.gradle of the project, and the other versions are on the build.gradle of the module. For example, for SDK 23, you must use the Build Tools 23.0.1 and gradle plugins version 1.3.1.”

這時,我想應該是有些東西包更新了,有些包沒更新導致的不匹配。又或者是那個360軟件把裏面的某個東西當做毒殺叼了。

這裏面有3個東西的版本,在我電腦的東西:

1、SDK:(在我電腦中的位置C:\Users\Administrator\AppData\Local\Android\sdk)

下載最新SDK,AS:file/setting/Android SDK/SDK platforms/選擇最新的Android API 下載,這裏用API 27.

技術分享圖片

2、Build Tools:

AS會根據.gradle文件上寫的版本號下載對應的tools。打開app文件夾下的build.gradle文件。

技術分享圖片

修改這兩個參數。更改為最新版本,build tools就可以自動下載。(如果之後更新的話,去百度,Google找最新的對應關系。)

compileSdkVersion 27
buildToolsVersion "27.0.3"

技術分享圖片

3、Gradle Plugins:(在我電腦中的位置:C:\Program Files\Android\Android Studio\gradle\gradle-4.7-all\gradle-4.7)

AS與Gradle版本之間的對應關系如下,我AS是2.3.3版本,所以只要是3.3以上的Gradle都可以用。這裏我用的是4.7

技術分享圖片

問題得到解決。ok

總結,這個問題應該是360誤殺了這個包中的部分文件導致不可用,因為之前是配置好的,我檢查了一下自己並沒有設置自動更新,每次更新都是需要我確認的。所以各位在處理這個問題的時候,要把360關掉。

總之出現這個問題,只要更新這3個部分就應該可以解決!

android studio bug : aidl is missing 解決方案