2017-08-05 132 views
0

我得到连接错误,而试图运行项目错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败?

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. 

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/print/PrintHelper$PrintHelperStubImpl.class

这里是我的build.gradle

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 

    defaultConfig { 
     applicationId "com.codecanyon.khalyil" 
     minSdkVersion 14 
     targetSdkVersion 25 
     multiDexEnabled true 


     ndk { 
      moduleName "player_shared" 
     } 
     dexOptions { 
      javaMaxHeapSize "4g" 
     } 
    } 



    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 
    sourceSets { 
     main { 
      jni.srcDirs = [] 
     } 
    } 
} 

dependencies { 
    compile 'com.google.android.gms:play-services:10.2.6' 
    compile files('libs/dagger-1.2.2.jar') 
    compile files('libs/javax.inject-1.jar') 
    compile files('libs/nineoldandroids-2.4.0.jar') 
    compile files('libs/support-v4-19.0.1.jar') 
    compile 'com.android.support:multidex:1.0.1' 

} 

我试图清理项目

建设 - >清洁

后重建,但没有效果

我同步并清理项目,仍然没有结果。

最后我点击“生成APK”,但问题仍然令人兴奋。

任何一个可以帮我

回答

0

这里的问题是,你必须包含在两个依赖的类。这很可能是v4的支持库。检查你的一个依赖项是否包含你已经包含的v4支持库。您可以排除依赖这种方式:

compile ('com.somesdk:sdk:[email protected]') { 
    transitive=true //you dont need this if you use jars or non-aar dependencies 
    exclude group: 'com.android.support' 
} 
相关问题