gpt4 book ai didi

android - 任务 ':app:compileDebugAidl' : aidl is missing 执行失败

转载 作者:IT老高 更新时间:2023-10-28 13:15:56 27 4
gpt4 key购买 nike

我在我的电脑上安装了 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'
}

最佳答案

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

所以我的解决方案是在应用程序中单击鼠标右键,如下图所示,然后选择“打开模块设置”

Image 1

那么您有 2 个选项。我已经用上一个版本更改了这两个版本。

将 SDK 版本编译为 API 21 Lollipop

enter image description here

和构建工具版本到 21.1.2

enter image description here

最后清理项目并构建

更新

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

  1. 通过选择"file">“设置”打开“设置”窗口。
  2. 选择外观和行为 > 系统设置 > 更新面板。
  3. 在“更新”面板上,选择自动检查更新选项:Canary Chanel
  4. 在“更新”面板上,选择“立即检查”以检查最新的 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。

关于android - 任务 ':app:compileDebugAidl' : aidl is missing 执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29766830/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com