2015-04-21 209 views
61

我在我的電腦上安裝了Android Studio。我創建了一個新項目,但是這給我下面的錯誤。我能做什麼?任務執行失敗':app:compileDebugAidl':aidl缺失

Error:Execution failed for task ':app:compileDebugAidl'. 
> aidl is missing 

我的Android Studio版本是1.1.0

這是我build.gradle文件:

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.1.0' 
     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 
allprojects { 
    repositories { 
     jcenter() 
    } 
} 

和:

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 21 
    buildToolsVersion "24.1.2" 

    defaultConfig { 
     applicationId "com.example.jo.cloning_a_login_screen" 
     minSdkVersion 13 
     targetSdkVersion 21 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:22.0.0' 
} 
+0

你有沒有發現這個問題的解決? –

+0

是的,我再次刪除我最後的android工作室,然後再從網站下載android studio,安裝。 ;) –

回答

80

在我來說,我下載版本的Android M和Android 5.1.1版本22採用Android工作室1.2.1.1,但我當嘗試做一個Hello World同樣的錯誤告訴我

因此,我的解決方案是做像下圖的應用程序右鍵單擊並選擇「打開模塊設置」

Image 1

那麼你有2個選項。我用最後一個版本改變了它們。

編譯SDK版本API 21棒棒堂

enter image description here

和構建工具版本21.1.2到

enter image description here

最後清理項目和建設

修訂

來獲得的Android 1.3工作室遵循通過選擇文件>設置這個步驟

  1. 打開設置窗口。
  2. 選擇外觀&行爲>系統設置>更新面板。
  3. 在「更新」面板上,選擇自動檢查更新:Canary Chanel
  4. 在「更新」面板上,選擇「立即檢查」以檢查最新的金絲雀版本。提示時下載並安裝構建。

然後你就會有這樣的事情來更新您的Androud工作室到1.3,並用這個你可以測試版本的Android M

Android 1.3

更新:真正的原因

這個錯誤發生在SDK,Build Tools和Gradle Plugins的版本不匹配(就兼容性而言)。解決方案是驗證您是否正在使用它們的最新版本。 gradle插件放置在項目的build.gradle中,其他版本位於模塊的build.gradle上。例如,對於SDK 23,您必須使用Build Tools 23.0.1和gradle插件1.3.1版。

+3

問題可能是Android gradle插件仍然是1.2.3,它需要是1.3--哪些[還沒有可用](http://repo1.maven.org/maven2/com/android/工具/編譯/ gradle產出/)。 – fattire

+0

是的。我認爲這是問題,直到我們有1.3版本,我們無法測試它。這裏有更多關於這方面的信息。還介紹如何開始使用M Developer Preview。 http://android-developers.blogspot.com/2015/05/android-m-developer-preview-tools.html –

+0

@JorgeCasariego我想知道你是否可以幫我解決這個問題http://goo.gl/d5opg5 。我承諾,這不是那些「修復這個對我來說」的問題。 – Axel

0

該問題實際上是在從金絲雀頻道更新的版本Android Studio 1.3中。我更新了我的studio爲1.3,並得到了相同的錯誤,但恢復到studio 1.2.1使我的項目運行良好。

8

我試圖卸載/安裝,它沒有工作。我在JDK 1.8.0_45-b14上運行帶有Android Studio 1.2.1.1的OSX 10.10.3,我發現的解決方案與Jorge Casariego的建議類似。基本上,開箱即可得到缺少'aidl'模塊的構建錯誤,只需將構建工具版本更改爲而不是即可獲得版本23.0.0 rc1將解決您的問題。它似乎有一個錯誤。

UPDATE 他們跟蹤器(https://code.google.com/p/android/issues/detail?id=175080)從Android工具組項目成員在Android問題評論後評論說,使用生成工具版本23.0.0 RC1你需要使用Android的搖籃插件1.3。 0-beta1(Android Studio配置了1.2.3)。他還指出(閱讀問題意見),IDE應該發出通知,告訴你需要這樣做才能使其工作。對於我來說,我沒有看到通知,我已經要求該項目成員澄清。儘管如此,他的指導很好地解決了這個問題。

解決方案:打開您的build.gradle爲您的項目(而不是模塊)。在dependencies下找到classpath com.android.tools.build:gradle:xxx行,其中xxx是Gradle插件版本並進行更新。保存並重建您的項目。這是用於管理您的Gradle版本的Android Gradle文檔:https://developer.android.com/tools/revisions/gradle-plugin.html

6

如果我還打開了項目級別build.gradle文件並設置了android的版本,我就能夠使用Build Build 23.0.0 rc1獲得構建版本構建插件到1.3.0-beta1。此外,我正在跟蹤金絲雀和預覽版本,並在幾秒鐘之前更新,所以也許有幫助。

// Top-level build file where you can add configuration options common to all sub-projects/modules. 

buildscript { 
    repositories { 
     jcenter() 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.3.0-beta1' 

     // NOTE: Do not place your application dependencies here; they belong 
     // in the individual module build.gradle files 
    } 
} 

allprojects { 
    repositories { 
     jcenter() 
    } 
} 
+0

看不到這是如何工作的,因爲https://repo1.maven.org/maven2/com/android/tools/build/gradle/上沒有/1.3.0-beta1(請參閱上面的註釋) - 您是否有maven設置使用其他存儲庫?我也使用AS的金絲雀版本。 – fattire

+0

這有點奇怪。我無法在互聯網上找到它,但實際上它已經在〜/ .gradle/caches/modules-2/files-2.1/com.android.tools.build/builder/1.3.0- beta1所以它肯定來自某個地方? pom提到https://android.googlesource.com/platform/tools/base作爲代碼網址。 –

+0

本頁內容:https://code.google.com/p/android/issues/detail?id=175080 Google Project成員發表評論說,「構建工具23.0.0_rc1需要Gradle插件1.3.0-beta1或更高版本。請使用它。應該有一個通知表明已經在IDE中。「 –

16

我使用的是Android工作室1.2.1.1的一個類似的錯誤有一個全新的安裝試圖建立一個新的空白應用程序的API 22:搭載Android 5.1(棒棒堂)。

我通過將構建工具版本從「23.0.0 rc1」更改爲「22.0.1」,然後重新構建來修復它。

在Windows上,F4打開項目結構和構建工具的版本可以在模塊>應用部分進行設置: enter image description here

我覺得這一切確實是更改設置在該文件的build.gradle應用程序,但我不想手動更改,以防萬一它有更多的東西。

4

快速修復爲我工作:

項目上點擊右鍵 - > 「打開模塊設置」 - >構建工具的版本改爲:22.0.1

enter image description here

3

本質馬特Daley/Johnny Mohseni的解決方案爲我工作。

我在新鮮的Android Studio V 1.2.1.1安裝中遇到了完全相同的問題。我創建了一個新項目(空白活動),並立即通過這個構建錯誤。

Error:Execution failed for task ':app:compileDebugAidl'. 
> aidl is missing 

如上所述,將gradle dependency從1.2.3更改爲1.3.0-beta1將其修正。

classpath 'com.android.tools.build:gradle:1.3.0-beta1' // <--- WORKS! 
//classpath 'com.android.tools.build:gradle:1.2.3' // <--- default - failed 

保存1.3.0-beta1更改後,我收到了升級依賴關係的提示。接受升級請求後,底部的Gradle構建狀態欄會跟蹤正在同步的軟件包。完成後,構建會自動觸發併成功完成。

+0

它不應該是'beta2'嗎? –

+0

只有beta1適合我。 beta2給出了相同的錯誤。 – sith

17

已固定的前兩天,所以你可以使用:

buildToolsVersion '23.0.0 rc2' 

了最新的Android gradle這個插件:

classpath 'com.android.tools.build:gradle:1.3.0-beta2' 

注: 我和gradle這個2.4分發一些奇怪的問題, ,但試圖再次建立這個項目已經解決了我的問題。

編輯

有強大的內置工具23較新的版本,所以你應該使用:

buildToolsVersion '23.0.0 rc3' 

EDIT 2

而且再一次,有更新版本的gradle插件和構建工具,所以你可以切換到使用:

classpath 'com.android.tools.build:gradle:1.3.0' 

buildToolsVersion '23.0.0' 
+1

看來,這個問題現在已經解決了,謝謝 – Than

3

我有同樣的錯誤,我首先要到build.gradle (Module: app)固定它,並從改變這一行:

buildToolsVersion "23.0.0 rc1" 

到:

buildToolsVersion "22.0.1" 

您需要去SDK Manager並檢查你是否有22.0.1構建工具。如果沒有,你可以使用正確的構建工具,但避免使用23.0.0 rc1。

0
在23.0.0.rc2

編譯工具佈局被恢復

所以能夠使用它,你需要將插件升級到1.3.0-β2或更高我下面顯示:

enter image description here

4

要與compileSdkVersion 23沒有aidl is missing錯誤構建應用程序和buildToolsVersion "23.0.1"你應該爲Android搖籃插件指定最新版本(和谷歌播放服務搖籃插件我F你在主build.gradle文件中使用它):

buildscript { 
    repositories { 
     ... 
    } 
    dependencies { 
     classpath 'com.android.tools.build:gradle:1.3.1' 
     classpath 'com.google.gms:google-services:1.3.1' 
    } 
} 
0

我與SDK 23.1.0和gradle這個1.3.1工作。我創建了一個新的項目編輯任何東西,並得到了aidl錯誤。我走進我的gradle項目文件,並改變工具22.0.1,而不是23.1.0和它的工作:

compileSdkVersion 23 
    buildToolsVersion "22.0.1" //"23.1.0" 
0

檢查,如果你確實已經安裝了您正在使用的buildVersionTools。在我的情況下,我嘗試了25.0.1,而我只有25.0.2。

要檢查它轉到SDK管理器,點擊圖標:

enter image description here

然後單擊啓動獨立SDK管理器底部:

enter image description here

現在檢查你需要什麼並安裝軟件包。

enter image description here

希望它能幫助!

0

使用您的文件瀏覽器和IInAppBillingService.aidl複製粘貼到/應用/ src目錄/主/ AIDL/COM /安卓/自動售貨機/計費/

相關問題