IntelliJ中的任务':app:compileDebugJavaWithJavac'执行失败

时间:2019-03-09 10:56:49

标签: android gradle intellij-idea

我已经在IntelliJ中打开了一个AndroidStudio项目。我将来想与IntelliJ合作,所以我想切换。

但是我得到了 任务':app:compileDebugJavaWithJavac'的执行失败 构建时出现错误,我不知道解决方案是什么。我已经尝试了一些提示,但是现在我需要问一下。

我的礼物:

apply plugin: 'com.android.application'

android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
    compileSdkVersion 27
    buildToolsVersion '27.0.2'
    defaultConfig {
        applicationId "xxx"
        minSdkVersion 19
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
//        manifestPlaceholders = [versionCode:"161", versionName:"2.37"]
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes {
        release {
            minifyEnabled false
            buildConfigField "String", "appID", "\"RELEASE\""
        }
        full {
            buildConfigField "String", "appID", "\"FULL\""
        }
        debug {
        }
    }
    compileOptions.encoding = 'ISO-8859-1'

}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:27.0.2'
    testCompile 'junit:junit:4.12'
    compile 'org.apache.commons:commons-lang3:3.5'
}

在“项目结构”下->项目SDK我已经设置了Java SDK 1.8。

有人可以帮我一个提示吗?

1 个答案:

答案 0 :(得分:0)

我认为,您的TargetedSdkVersion小于compileSdkVersion。定位到27,然后尝试同步。