Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/196.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓工作室赢得';t编译改造_Android_Android Studio_Gradle_Retrofit_Retrofit2 - Fatal编程技术网

Android 安卓工作室赢得';t编译改造

Android 安卓工作室赢得';t编译改造,android,android-studio,gradle,retrofit,retrofit2,Android,Android Studio,Gradle,Retrofit,Retrofit2,几天前,我为我正在开发的一个应用程序(bea版本)生成了签名apk。 我现在正试图编译该项目的改造,同步阶段运行良好,但当我尝试运行该应用程序时,我遇到以下错误: Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessE

几天前,我为我正在开发的一个应用程序(bea版本)生成了签名apk。 我现在正试图编译该项目的改造,同步阶段运行良好,但当我尝试运行该应用程序时,我遇到以下错误:

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException:
com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 
'command'/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java'' 
finished with non-zero exit value 2
我试着在新项目上编译改造,它确实编译了

以下是依赖项(我试图单独对简单xml进行注释,但也没有帮助):


有什么想法吗?

尝试使用更新版本的改装:

    compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'

搜索、更新Android Studio并多次尝试后: multidexEnabled true->除了某些部分之外没有帮助。 我真正需要的是:

  • 删除以下内容:

    compile 'com.loopj.android:android-async-http:1.4.9'"
    
  • (要么它使用的是另一个库已经编译过的软件包,要么它使应用程序超过了64k的限制,无论哪种方式,它都是可有可无的,因为改型提供了内置的OkHttp)

    2.将简单xml更改为以下内容:

    compile ('com.squareup.retrofit2:converter-simplexml:2.0.1') {
            exclude group: 'xpp3', module: 'xpp3'
            exclude group: 'stax', module: 'stax-api'
            exclude group: 'stax', module: 'stax'
    }
    
    我不确定“stax”行,但“xpp3”肯定出现在错误中。我在另一篇文章中找到了这个答案


    我希望它也能帮助其他人。

    您的意思是针对Java 8进行编译吗?你试过反对Java 7吗?我如何编译反对Java 7的AAGAIN@Wolfbane我在新项目中也做了同样的事情,它编译了我不在AS前面,所以从内存:项目设置->项目->项目语言级别->设置为7。如果它在一个新项目中起作用,那么我怀疑它是一个扭曲的项目配置。
    compile ('com.squareup.retrofit2:converter-simplexml:2.0.1') {
            exclude group: 'xpp3', module: 'xpp3'
            exclude group: 'stax', module: 'stax-api'
            exclude group: 'stax', module: 'stax'
    }