【问题标题】:gradle task failed!org.gError:Execution failed for task ':app:> com.android.ide.common.process.ProcessExceptiongradle task failed!org.gError:Execution failed for task ':app:> com.android.ide.common.process.ProcessException
【发布时间】:2016-04-13 11:35:32
【问题描述】:

我尝试用谷歌搜索,但还是不行!
我的jdk环境配置是正确的。
我不知道我的项目出了什么问题,你知道如何处理吗?

这是错误信息:

Information:Gradle tasks [:app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42321Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2321Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithDexForDebug
trouble processing "javax/xml/XMLConstants.class":

Ill-advised or mistaken usage of a core class (java.* or javax.*)
when not building a core library.
This is often due to inadvertently including a core library file
in your application's project, when using an IDE (such as
Eclipse). If you are sure you're not intentionally defining a
core class, then this is the most likely explanation of what's
going on.
However, you might actually be trying to define a class in a core
namespace, the source of which you may have taken, for example,
from a non-Android virtual machine project. This will most
assuredly not work. At a minimum, it jeopardizes the
compatibility of your app with future versions of the platform.
It is also often of questionable legality.
If you really intend to build a core library -- which is only
appropriate as part of creating a full virtual machine
distribution, as opposed to compiling an application -- then use
the "--core-library" option to suppress this error message.
If you go ahead and use "--core-library" but are in fact
building an application, then be forewarned that your application
will still fail to build or run, at some point. Please be
prepared for angry customers who find, for example, that your
application ceases to function once they upgrade their operating
system. You will be to blame for this problem.
If you are legitimately using some code that happens to be in a
core package, then the easiest safe alternative you have is to
repackage that code. That is, move the classes in question into
your own package namespace. This means that they will never be in
conflict with core system classes. JarJar is a tool that may help
you in this endeavor. If you find that you cannot do this, then
that is an indication that the path you are on will ultimately
lead to pain, suffering, grief, and lamentation.

1 error; aborting

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_31\bin\java.exe'' finished with non-zero exit value 1
Information:BUILD FAILED
Information:Total time: 12.475 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

【问题讨论】:

  • 运行我的应用时发生错误
  • dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') // testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7 :23.2.1' 编译 'org.apache.poi:poi:3.14' 编译 'org.apache.poi:poi-ooxml:3.14' 编译 'org.apache.poi:poi-ooxml-schemas:3.14' 编译 'dom4j :dom4j:1.6.1' }
  • 出了什么问题:任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:org/apache/xmlbeans/xml/stream/Location.class
  • 我的英语很差,请帮帮我。
  • 请格式化您的问题,至少遵守错误消息中的段落。很难阅读。见stackoverflow.com/help/formatting

标签: java android android-studio


【解决方案1】:

maven 本身的 xmlbeans jar 中似乎存在一些问题。

你需要准备好jar,放到libs文件夹中。

检查this SO中的答案

【讨论】:

    【解决方案2】:

    有时它会在 Android-studio 中发生,重新启动您的 Android Studio 并再次运行。希望它会有所帮助

    【讨论】:

    • 任务 ':app:transformClassesWithJarMergingForDebug' 执行失败。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:org/apache/xmlbeans/xml/stream/Location.class
    • 它说我有相同的重复条目,我该如何处理?
    • 在终端打开你的项目根目录添加这个命令“./gradlew clean”对于Windows - “.\gredlew.bat clean”它会工作。
    • 我已经试过了,好像apache jar中有两个相同的类。我用了3个poi jar。
    猜你喜欢
    • 1970-01-01
    • 2021-09-04
    • 2016-07-15
    • 1970-01-01
    • 2019-11-11
    • 2020-11-06
    • 1970-01-01
    • 2022-11-17
    • 2022-12-19
    相关资源
    最近更新 更多