任务 ':app:compileDebugAidl' 执行失败:aidl 丢失 [英] Execution failed for task ':app:compileDebugAidl': aidl is missing

查看:33
本文介绍了任务 ':app:compileDebugAidl' 执行失败:aidl 丢失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的电脑上安装了 Android Studio.我创建了一个新项目,但出现以下错误.我能做什么?

I installed Android Studio on my computer. I created a new project but that got me the error below. What can I do?

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

我的 Android Studio 版本是 1.1.0.

My Android Studio version is 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'
}

推荐答案

就我而言,我使用 Android Studio 1.2.1.1 下载了 Android M 和 Android 5.1.1 的 22 版,但是当我尝试执行 Hello World 时出现同样的错误给我看了

In my case I downloaded version 22 of Android M and Android 5.1.1 using Android Studio 1.2.1.1 but when I try to do a Hello World this same error showed me

所以我的解决方案是在如下图所示的应用程序中右键单击并选择打开模块设置"

So the solution for me was doing right click in app like the image below and choose "Open Module Settings"

那么你有两个选择.我在上一个版本中对两者进行了更改.

then there you have 2 options. I've changed both with the last version I had.

将 SDK 版本编译为 API 21 Lollipop

Compile SDK version to API 21 Lollipop

和构建工具版本到 21.1.2

and Build Tools Version to 21.1.2

最后清理项目并构建

更新

要获取 Android Studio 1.3,请按照下列步骤操作

TO Get Android Studio 1.3 follow these steps

  1. 通过选择文件">设置"打开设置"窗口.
  2. 选择外观&行为 > 系统设置 > 更新面板.
  3. 在更新"面板上,选择自动检查更新"选项:Canary Chanel.
  4. 在更新"面板上,选择立即检查"以检查最新的 Canary 版本.出现提示时下载并安装构建版本.

然后你将有类似的东西将你的 Androud Studio 更新到 1.3,然后你就可以测试 Android M

Then you'll have something like this to update your Androud Studio to 1.3 and with this you can test Android M

当 SDK、构建工具和 Gradle 插件的版本不匹配(在兼容性方面)时,会发生此错误.解决方案是验证您是否使用它们的最新版本.gradle插件放在项目的build.gradle中,其他版本在模块的build.gradle中.例如,对于 SDK 23,您必须使用 Build Tools 23.0.1 和 gradle plugins 版本 1.3.1.

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.

这篇关于任务 ':app:compileDebugAidl' 执行失败:aidl 丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆