繁体   English   中英

android运行失败错误:任务':app:compileDebugJavaWithJavac'的执行失败

[英]android run failed Error:Execution failed for task ':app:compileDebugJavaWithJavac'

Android Studio 构建成功,但是当我单击运行应用程序时出现以下错误:

错误:任务 ':app:compileDebugJavaWithJavac' 的执行失败。 编译失败; 有关详细信息,请参阅编译器错误输出。

在终端中运行./gradlew complileDebug --stacktrace --info ,我收到以下异常:

org.gradle.execution.TaskSelectionException:任务“compileDebug”在根项目“gp2-android”中不明确。 候选对象是:'compileDebugAidl'、'compileDebugAndroidTestAidl'、'compileDebugAndroidTestJavaWithJavac'、'compileDebugAndroidTestNdk'、'compileDebugAndroidTestRenderscript'、'compileDebugAndroidTestShaders'、'compileDebugAndroidTestSources'、'compileDebugJavaWithJavac'、'compileDebugNdDebugs'compileDebugs'compile'Renderscript' , 'compileDebugUnitTestJavaWithJavac', 'compileDebugUnitTestSources'。 在 org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:100) 在 org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:75)

这是我的代码:

apply plugin: 'com.android.application'
apply plugin: 'android-apt'


android {
compileSdkVersion 23
buildToolsVersion '23.0.3'

defaultConfig {
    applicationId "com.guanplus.app.android"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "v1.0.1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {

    debug {
        debuggable true
        buildConfigField("boolean", "DEBUG_SERVER_HOST", "true")
        buildConfigField("String", "DEFAULT_IDENTITY_SERVER_HOST", "\"https://api-identity-dev.guanplus.com\"")
        buildConfigField("String", "DEFAULT_ACCOUNTING_SERVER_HOST", "\"http://api-accounting-dev.guanplus.com\"")
        buildConfigField("String", "DEFAULT_WEB_HOST", "\"https://web-gp2-dev.guanplus.com/\"")
        minifyEnabled false
    }

    staging{
        debuggable false
        buildConfigField("boolean", "DEBUG_SERVER_HOST", "false")
        buildConfigField("String", "STAGE_IDENTITY_SERVER_HOST", "\"http://api-identity-stage.guanplus.com\"")
        buildConfigField("String", "STAGE_ACCOUNT_SERVER_HOST", "\"http://api-accounting-stage.guanplus.com\"")
        buildConfigField("String", "STAGE_WEB_HOST", "\"https://web-gp2-stage.chinacloudsites.cn/\"")
        minifyEnabled true
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }

    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }

packagingOptions {
    exclude 'META-INF/LICENSE.txt'
    exclude 'META-INF/NOTICE.txt'
    exclude '.readme'
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])

compile project(':datepicker')
compile project(':loadinglib')
//complie project(path: ':adapterlibrary')

compile 'com.android.support:design:23.1.0'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha2'

//recycleview
compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:v2.0.5'
compile 'com.google.code.gson:gson:2.4'
//rxjava*
compile 'io.reactivex:rxjava:x.y.z'
compile 'io.reactivex:rxandroid:1.0.1'
//retrofit*
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
//retrofit logging*
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'
//inject butterknife
compile 'com.jakewharton:butterknife:8.2.1'
apt 'com.jakewharton:butterknife-compiler:8.2.1'
//recycleview
compile 'com.jcodecraeer:xrecyclerview:1.2.7'
compile 'com.yqritc:recyclerview-flexibledivider:1.4.0'
//rxliftcycle
compile 'com.trello:rxlifecycle:0.6.1'
compile 'com.trello:rxlifecycle-components:0.6.1'
//material design
compile 'com.github.rey5137:material:1.2.4'
compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
//MPAndroidChart
compile 'com.github.PhilJay:MPAndroidChart:v3.0.0-beta1'
//smartlayout
compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
//load pdf
compile 'com.github.barteksc:android-pdf-viewer:2.0.1'
//spin kit
compile 'com.github.ybq:Android-SpinKit:1.0.5'
//BUGhd
compile 'im.fir:fir-sdk:latest.integration@aar'

//test
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'

}

无法确定任务“:app:compileDebugJavaWithJavac”的依赖关系。

在项目“app”中,已解析的 Google Play 服务库依赖项依赖于另一个确切版本(例如“[18.0.0]”,但未解析为该版本。库表现出的行为将是未知的。

解决方案: Platform->android->Project.properties在此文件中将此版本替换为-> cordova.system.library.6=com.google.firebase:firebase-messaging:18+ -> cordova.system.library.6= com.google.firebase:firebase-messaging:19.0.0

暂无
暂无

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

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