使用Simple XML会生成gradle错误

时间:2016-05-15 14:49:54

标签: android gradle xml-parsing android-gradle

我尝试使用Simple XML with Retrofit,但在启动应用程序的过程中,我有gradle错误。但如果我使用Gson,我没有错误。如何解决问题?

操作系统:Windows 10

Gradle版本:2.10

的build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.timur.testretrofit"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.squareup.retrofit2:retrofit:2.0.2'
    compile 'com.squareup.retrofit2:converter-simplexml:2.0.2'
}

Gradle结果:

Executing tasks: [:app:clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:assembleDebug]

Configuration on demand is an incubating feature.
WARNING: Dependency xpp3:xpp3:1.1.3.3 is ignored for debug as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
WARNING: Dependency xpp3:xpp3:1.1.3.3 is ignored for release as it may be conflicting with the internal version provided by Android.
         In case of problem, please repackage it with jarjar to change the class packages
Incremental java compilation is an incubating feature.
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library
:app:prepareComAndroidSupportAppcompatV72340Library
:app:prepareComAndroidSupportDesign2340Library
:app:prepareComAndroidSupportRecyclerviewV72340Library
:app:prepareComAndroidSupportSupportV42340Library
:app:prepareComAndroidSupportSupportVectorDrawable2340Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:mergeDebugAndroidTestShaders
:app:compileDebugAndroidTestShaders
:app:generateDebugAndroidTestAssets
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:mockableAndroidJar UP-TO-DATE
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:buildInfoDebugLoader
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:transformClassesWithInstantRunForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug UP-TO-DATE
:app:incrementalDebugTasks
:app:prePackageMarkerForDebug
:app:fastDeployDebugExtractor
:app:generateDebugInstantRunAppInfo
:app:coldswapKickerDebug
:app:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexForDebug
To run dex in process, the Gradle daemon needs a larger heap.
It currently has approximately 910 MB.
For faster builds, increase the maximum heap size for the Gradle daemon to more than 2048 MB.
To do this set org.gradle.jvmargs=-Xmx2048M in the project gradle.properties.
For more information see https://docs.gradle.org/current/userguide/build_environment.html

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

:app:transformClassesWithDexForDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_92\bin\java.exe'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 16.999 secs

1 个答案:

答案 0 :(得分:0)