繁体   English   中英

无法确定任务的依赖关系

[英]Could not determine the dependencies of task

Error:Could not determine the dependencies of task :app:transformClassesWithInstantRunForDebug.

要在运行API 17的设备上使用“即时运行”,您必须在SDK中安装平台17

我该如何解决这个错误?

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.2"

    defaultConfig {
        applicationId "com.google.firebase.quickstart.fcm"
        minSdkVersion 9
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'LICENSE.txt'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:24.2.1'


    compile 'com.google.firebase:firebase-messaging:9.6.1'

    // Testing dependencies
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support:support-annotations:24.2.1'
}

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

我有同样的问题。 我通过重新启动IntelliJ IDEA,adb服务器并将我的智能手机重新连接到adb来解决它。

  1. 导航到Android Studio - >首选项(MacOS)/设置(Windows) - >外观和行为 - >系统设置 - > Android SDK - > SDK平台。
  2. 勾选Android 4.2 (Jelly Bean)
  3. 按Apply。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM