2016-09-28 34 views
1

我用我的应用程序和一些错误的改造和Okhttp都被赶了出来很好地工作,首先我排除在改造和okhttp奥基奥和GSON解决我编译,但它无法正常工作精致,它使带来的误差,每次这是错误:执行失败的任务“:应用程序:transformClassesWithJarMergingForDebug”。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复的条目:COM /谷歌/ GSON /注释/ Expose.class另一次它将带来的是奥基奥作为奥基奥/ asyncTimeout,我该如何解决这个问题?改造和Okhttp不会对我的应用

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile files('libs/mobilesec.jar') 
    compile files('libs/org-apache-commons-codec.jar') 
    compile files('libs/apache-commons-lang.jar') 
    compile files('libs/core-1.51.0.0.jar') 
    compile files('libs/gson-2.0.2.jar') 
    compile files('libs/okio-1.2.0.jar') 
    compile files('libs/sqliteassethelper-2.0.1.jar') 
    compile 'com.android.support:support-v4:21.+' 
    compile 'com.android.support:appcompat-v7:21.+' 
    compile files('libs/gcm.jar') 
    compile 'com.crittercism:crittercism-android-agent:+' 
    compile 'com.google.android.gms:play-services-wearable:6.5.87' 
    compile ('com.squareup.okhttp3:logging-interceptor:3.2.0'){ 
     exclude module: 'com.squareup.okio' 
    } 
    compile 'com.android.support:multidex:1.0.0' 

} 
+0

你真的需要的okhttp依赖。据我所知Retrofit建立在okhttp之上。 – Vall0n

+0

那么人们通常使用Gradle来完成他们的依赖关系而不是随机jar – EpicPandaForce

回答

0

你GSON和奥基奥罐子复制..删除

compile files('libs/gson-2.0.2.jar') 
compile files('libs/okio-1.2.0.jar') 

但..你为什么要加载的依赖都通过本地的jar和远程资源库?我建议只使用远程依赖关系。

编辑:您可以渲染的依赖关系树用命令gradle dependencies。运行它并检查为什么gson被添加两次。

+0

可以请你解释加载通过远程存储库本地jar的缺点 –

+0

我正在尝试你的答案 –

+0

错误:执行失败的任务':app:transformClassesWithJarMergingForDebug ”。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复的条目:COM /谷歌/ GSON /注释/ Expose.class –