【问题标题】:Android Studio: execution failed for task : app:compileDebugAidl FAILEDAndroid Studio:任务执行失败:app:compileDebugAidl FAILED
【发布时间】:2015-08-11 16:20:33
【问题描述】:

我安装了 Android Studio 1.2.1.1、Gradle 版本 2.2.1 和 Android 插件版本 1.2.3。我试图创建一个简单的 hello world 项目,它给了我一个构建失败:app:compileDebugAidl FAILED。我是否缺少某些内容或版本不兼容,因为这应该是一个简单的应用程序。感谢您的帮助。

这是我得到的编译错误:

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl FAILED
Error:Execution failed for task ':app:compileDebugAidl'.
> aidl is missing
Information:BUILD FAILED

【问题讨论】:

标签: android android-gradle-plugin


【解决方案1】:

尝试运行仅包含<intent-filter> 的特定活动,而不是运行整个应用程序,然后尝试运行整个应用程序。

【讨论】:

    【解决方案2】:

    版本兼容性 发布 1.0 兼容性 从 Android Studio 1.0 和 Android 1.0 的 Gradle 插件开始,兼容性是一项关键要求。 虽然我们仍在考虑最终确定我们的政策,但您至少应该期望:

    Studio 1.x 与 Gradle 插件 1.y 一起使用

    Newer versions of the Gradle plugin may require newer versions of Studio to enable the new features in the IDE, but the project should open in older versions of Studio, and build from there (since Gradle does the build). We will be very careful about this.
     We will determine later our compatibility story between Studio 2.x and Gradle Plugin 1.x and between Studio 1.x and Gradle Plugin 2.x
    We will make every effort to keep compatibility where possible, and to provide good Quick Assist to help with migration where applicable.
    

    Gradle 插件 1.0.0 - 1.1.3 适用于 Gradle 2.2.1 - 2.3。

    It does not work with Gradle 2.4+
    

    Gradle 插件 1.2+ 适用于 Gradle [2.2.1, 3.0[

    Newer versions of the Plugin may require a newer version of Gradle to benefit from advanced features.
    
    However the current 1.2+ should work with [2.2.1, 3.0[
    (We cannot guaranteed compatibility with 3.x as it may introduce breaking changes: Gradle 1.x -> 2.0 introduced Groovy breaking changes)
    
    
    Android Studio      Android Gradle Plugin      Gradle
    
    1.0.0+               1.0.0 - 1.1.3           2.2.1 - 2.3
    1.0.0+               1.2+                    2.2.1+
    

    后 1.0 DSL 兼容性

    DSL 在 1.0 之前变化很大,但现在应该稳定了。

    如果/当我们需要更改内容时,我们将有很长的弃用期,可能超过 6 个月,也可能是 12 个月。 预览兼容性 此表指示 1.0 之前的组件的兼容性。

    所有这些重大变化的发生都是因为我们对 IDE 和 Gradle 之间交换的模型进行了很多调整。所有这些工作都是为了确保 1.0 之后的稳定性。

    欲了解更多信息,请访问http://tools.android.com/tech-docs/new-build-system/version-compatibility

    【讨论】:

      【解决方案3】:

      有时错误的来源不是很清楚。我曾尝试重构一个包,但我的一个类具有旧包名,导致编译失败。我通过在我的路径中搜索 Gradle 控制台中生成的错误发现了错误。我的项目中有旧的包名称,我自己更改了它。然后我的 APK 编译好了。

      【讨论】:

        【解决方案4】:

        我通过更新 Android SDK 构建工具解决了这个问题。

        SDK Manager > Tool > Android SDK build Tool > Install> Restart

        【讨论】:

          【解决方案5】:

          转到 File->settings->build->gradle 并选择 Use default gradle wrapper (recommended)

          【讨论】:

          • 我忘了提到我必须删除 SDK 23.X rc 这会导致问题
          【解决方案6】:

          我遇到了同样的问题。

          右键单击应用程序 -> 打开模块设置。在此菜单中将“构建工具版本”设置为版本 22.0.1。

          设置后,我能够成功构建项目。

          【讨论】:

          • 感谢您的修复。为澄清起见,这是 Android Studio 附带的错误还是我的设置可能有问题?
          • Android Studio 真的很烦人,因为它的 bug。
          • 我想是因为你不小心在Android SDK manager中安装了Android SDK Build-tools 23 rc2。所以这不是 Android Studio 特有的问题。
          【解决方案7】:

          我遇到了同样的问题并通过将 Preferences -> Build,Execution,Deployment -> Build Tools -> Gradle -> Project-level settings 从“Use local gradle distribution”更改为“Use default gradle wrapper(推荐) '。

          希望对你有帮助。

          【讨论】:

          • 仅供参考:从 1.2.1.1 版开始,您可以在文件 > 设置 > 构建、执行、部署 > 构建工具 > Gradle 下找到此设置
          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2015-06-28
          • 2021-02-13
          • 2015-05-23
          • 2016-12-18
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多