误差=>无法确定任务':app:compileDebugJavaWithJavac'

时间:2018-01-07 16:41:41

标签: android android-studio

我在Android Studio中执行Android应用时出现问题,如下所示,显示错误。我该如何解决这个问题?

Error:Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'. Could not create service of type AnnotationProcessorDetector using JavaGradleScopeServices.createAnnotationProcessorDetector().

的build.gradle:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.example.toshiba.bluetooth_deneme"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile 'com.android.support:support-annotations:27.0.2'
}

1 个答案:

答案 0 :(得分:0)

我遇到了类似的问题,结果发现我的项目需要重新同步。单击下面的按钮为我修复了该问题。 (我不能说为什么会这样。)

Sync Project Button