android - Android Studio 中缺少 aidl

标签 android android-studio gradle google-cloud-messaging

我正在尝试运行 Sample of Google Cloud Messaging适用于使用 Android SDK 版本 6.0、API 23 的 Android 现在示例已使用 API 22,但我想运行 API 23,因此我在应用程序级别的 built.gradle 文件中所做的更改如下。

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 'Google Inc.:Google APIs:23'
    buildToolsVersion '23.0.0'

    defaultConfig {
        applicationId "gcm.play.android.samples.com.gcmquickstart"
        minSdkVersion 9
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'LICENSE.txt'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.android.gms:play-services-gcm:7.8.0'
    compile 'com.android.support:appcompat-v7:23.0.0'
    // Testing dependencies
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.1'
    androidTestCompile 'com.android.support.test:runner:0.2'
    androidTestCompile 'com.android.support:support-annotations:23.0.0'
}

我更新了Android Studio到最新版本,但是现在出现如下错误。

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

我试过的解决方案updating android studio如链接中所示。

最佳答案

为了解决这个问题,我首先将构建工具更改为 23.0.1,如下所示:

compileSdkVersion 23
buildToolsVersion "23.0.1"

我的 targetSdkVersion 也设置为 23。

并在顶级脚本中更新这些参数:

    classpath 'com.android.tools.build:gradle:1.3.0'
    classpath 'com.google.gms:google-services:1.3.0-beta1'

希望对您有所帮助。

关于android - Android Studio 中缺少 aidl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32365805/

相关文章:

android - React Native - 如何从 componentWillReceiveProps 重定向到登录 View

java - Android GPS不正确的查询位置数据

java -> 无法隔离参数 com.android.build.gradle

android - android studio中的test目录有什么用?

c# - 无法从 android studio 项目连接到 localhost webapi

java - 无法在android中保存实例状态

scala - SBT:排除资源子目录

java - gradle 测试任务如何运行特定的 junit 测试套件?

java - 如何为 Java 代码强制执行标准样式?

Android SDK 和 AVD Manager 设置菜单在哪里?