gpt4 book ai didi

java - 无法解决 Android 错误 :Execution failed for task ':app:compileDebugJavaWithJavac'

转载 作者:太空狗 更新时间:2023-10-29 16:32:35 26 4
gpt4 key购买 nike

仍然有以下错误:

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

即使在 stackoverflow 上尝试了解决方案之后,我仍然无法解决这个问题。有人指导我如何解决这个问题吗?

当我同步我的项目时,一切正常,但当我运行应用程序时,它崩溃了。在过去的一个月里,一切正常,但突然崩溃了。

目标 Api 22 因为 creativesdk 可以很好地使用这个基于我在网站 Adobe Creative sdk 上遇到的博客的 api。

完整错误信息:

: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。和

编译选项{
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

我建议您尝试使用 java 1.7。我不确定,但错误看起来像 this无法解析您的文本。

我也建议 编译器 (1.8.0_60) 中发生异常。请在 Java 错误数据库中提交错误。

关于java - 无法解决 Android 错误 :Execution failed for task ':app:compileDebugJavaWithJavac' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35046673/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com