Android Studio错误:任务':app:compileDebugJavaWithJavac'执行失败

时间:2017-06-12 07:46:35

标签: android android-studio gradle

我将Android Studio和sdk工具更新到最新版本,现在我收到了这个错误。我相应地更新了Google服务和firebase依赖项。我试图清理并重建项目,结果相同。

Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.NullPointerException: element == null

这是我的gradle构建:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
    applicationId "com.crisser.beitnaonline"
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
    "android.support.test.runner.AndroidJUnitRunner"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', 
{
    exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
compile('com.android.support:cardview-v7:23.2.0') {
    force = true
}
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:11.0.0'
compile 'com.google.firebase:firebase-auth:11.0.0'
compile 'com.google.firebase:firebase-core:11.0.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.android.gms:play-services-maps:11.0.0'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 
'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.appolica:interactive-info-window:v1.0.6'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0-RC0'
}
apply plugin: 'com.google.gms.google-services'

任何人都知道为什么这样做?它在25.0.3下运行得很好。

1 个答案:

答案 0 :(得分:0)

我遇到了同样的问题。我刚刚删除了添加的依赖项,我的应用开始正常运行。

您应该一个一个地删除库并构建应用程序。