【问题标题】:Gradle ADT 0.4 error: android.buildToolsVersion is missingGradle ADT 0.4 错误:缺少 android.buildToolsVersion
【发布时间】:2013-05-23 19:55:07
【问题描述】:

尝试使用 Gradle 的最新 ADT 工具版本构建我的 Android 项目,我收到以下错误:

Execution failed for task ':compileDebugAidl'.
> android.buildToolsVersion is missing!

使用 Gradle 1.6,Android 插件 0.4。

【问题讨论】:

    标签: android gradle adt


    【解决方案1】:

    确保您已下载最新的 ADT、SDK、平台和构建工具。然后将其添加到您的 gradle 构建中。

    android {
         buildToolsVersion "17.0"
         compileSdkVersion 15
    }
    

    credit to the adt mailing group.

    注意:如图所示将 " 放在 17.0 周围很重要 - 否则将不起作用

    【讨论】:

    • 此答案仅适用于您可能尚未安装的特定版本的 Android 构建工具。我在下面的回答显示了在哪里可以为您安装的任何构建工具获取正确的 buildToolsVersion。
    • 这对我不起作用。使用 gradle 1.7 和 Android 插件 0.5.6,在引号中设置 buildToolsVersion 仍然会导致“android.buildToolsVersion is missing”。
    【解决方案2】:

    buildToolsVersion 值取决于您从 Google 下载的版本。

    假设您安装了 Android SDK,从命令行运行“android”以打开 Android SDK 管理器。在左栏中,您将看到工具 | Android SDK 构建工具。这会告诉您是否已经安装了 Build-tools。

    安装 Build-tools 后,查看第二列,标记为“Rev”。它具有用于 gradle 的 buildToolVersion 的 Build-tools 版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-10-17
      • 1970-01-01
      • 1970-01-01
      • 2021-09-03
      • 1970-01-01
      • 2019-02-09
      • 1970-01-01
      相关资源
      最近更新 更多