簡體   English   中英

無法解決Android錯誤:任務':app:compileDebugJavaWithJavac'的執行失敗

[英]Cannot solve Android Error:Execution failed for task ':app:compileDebugJavaWithJavac'

仍然存在以下錯誤:

 Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
 Compilation failed; see the compiler error output for details.

即使嘗試過關於stackoverflow的解決方案,我仍然停留在如何解決此問題上。 有人指導我如何解決這個問題嗎?

當我同步我的項目時,一切正常,但是當我運行應用程序時,它崩潰了。 在過去的一個月中,一切正常,然后突然崩潰了。

自從creativesdk與基於博客的此api配合良好以來,我Api 22定位為Api 22了,我遇到了Adobe Creative sdk網站。

完整的錯誤消息:

:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
An exception has occurred in the compiler (1.8.0_60). Please file a bug at the Java Bug Database (http://bugreport.java.com/bugreport/) after checking the database for duplicates. Include your program and the following diagnostic in your report.  Thank you.
java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file com/sun/tools/javac/tree/DocTreeMaker
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)  
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.sun.tools.javac.parser.ParserFactory.<init>(ParserFactory.java:73)
at com.sun.tools.javac.parser.ParserFactory.instance(ParserFactory.java:54)
at com.sun.tools.javac.main.JavaCompiler.<init>(JavaCompiler.java:356)
at com.sun.tools.javac.main.JavaCompiler.instance(JavaCompiler.java:88)
at com.sun.tools.javac.main.Main.compile(Main.java:485)
at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)
at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:45)
at org.gradle.api.internal.tasks.compile.JdkJavaCompiler.execute(JdkJavaCompiler.java:33)
at org.gradle.api.internal.tasks.compile.daemon.CompilerDaemonServer.execute(CompilerDaemonServer.java:53)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:360)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745):app:compileDebugJavaWithJavac FAILED
Error:Execution failed for task ':app:compileDebugJavaWithJavac'
Compilation failed; see the compiler error output for details.

我的build.gradle(app):

apply plugin: 'com.android.application'

buildscript {
repositories {
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
}
}

allprojects {
apply plugin: 'maven'

tasks.withType(JavaCompile) {
    options.fork = true

    options.incremental = true
}
repositories {
    mavenCentral()
    jcenter()

    maven {
        url "${project.rootDir}/creativesdk-repo/release"  //ADD THE CORRECT LOCATION OF THE CREATIVESDK LIBRARY FILES
    }
}
}

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "com.example.yo.mophoto"
    minSdkVersion 21
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
    renderscriptTargetApi 22
    renderscriptSupportModeEnabled true
}
signingConfigs {
    release {
        storeFile file('release.key')
        storePassword '123456'
        keyAlias 'alias'
        keyPassword '123456'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_7
    targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
    main {
        setRoot 'src/main'
    }

    debug {
        setRoot 'src/debug'
    }
}
buildTypes {
    release {
        signingConfig signingConfigs.release
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        debuggable true
        minifyEnabled false
    }
}
packagingOptions {
    exclude 'META-INF/NOTICE.txt'
    exclude 'META-INF/LICENSE.txt'
}
dexOptions {
    jumboMode true
    incremental true
    preDexLibraries false
    javaMaxHeapSize "4g"
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.adobe.creativesdk:image:4.0.0'
compile 'com.android.support:recyclerview-v7:22.0.0'
compile 'com.android.support:cardview-v7:22.2.1'
compile 'org.lucasr.twowayview:twowayview:0.1.4'
compile files('libs/universal-image-loader-1.9.0.jar')
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
}

似乎您正在使用Java 1.8。

compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 }

我建議您嘗試使用Java 1.7。 我不確定,但錯誤看起來像這樣無法解析您的文本。

我也建議An exception has occurred in the compiler (1.8.0_60). Please file a bug at the Java Bug Database. An exception has occurred in the compiler (1.8.0_60). Please file a bug at the Java Bug Database.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM