我在计算机上安装了Android Studio。我创建了一个新项目,但是却出现了以下错误。我能做什么?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'}
3 回答
蝴蝶不菲
TA贡献1810条经验 获得超4个赞
就我而言,我使用Android Studio 1.2.1.1下载了Android M和Android 5.1.1的版本22,但是当我尝试做Hello World时,同样的错误向我显示
因此,对我来说,解决方案是在应用程序中右击,如下图所示,然后选择“打开模块设置”
那么您就有2个选择。我使用的最新版本都更改了。
将SDK版本编译为API 21 Lollipop
并将构建工具版本升级到21.1.2
最后清理项目并构建
更新
要获取Android Studio 1.3,请按照以下步骤操作
通过选择“文件”>“设置”打开“设置”窗口。
选择“外观和行为>系统设置>更新”面板。
在“更新”面板上,选择选项自动检查以下项目的更新:Canary Chanel。
在“更新”面板上,选择“立即检查”以检查最新的Canary版本。出现提示时,下载并安装内部版本。
然后,您将获得类似的内容,将Androud Studio更新到1.3,并可以测试Android M
Android 1.3
更新:真正的原因
当SDK,构建工具和Gradle插件的版本不匹配时(在兼容性方面),将发生此错误。解决方案是验证您是否正在使用它们的最新版本。gradle插件位于项目的build.gradle中,其他版本位于模块的build.gradle中。例如,对于SDK 23,必须使用Build Tools 23.0.1和gradle插件1.3.1版。
- 3 回答
- 0 关注
- 2440 浏览
添加回答
举报
0/150
提交
取消