2017-06-27 31 views
0

enter image description here我想从jar中排除一个类,但它不起作用。 让我知道很热。如何在Android Studio中从jar中排除一个类

这是我的代码:

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile ('com.google.android.gms:play-services-gcm:8.3.0') { 
     exclude module: 'com.google.android.gms.iid/zzb' 
    } 
    compile 'org.xwalk:xwalk_core_library:14.43.343.17' 
    compile 'com.google.code.gson:gson:2.4' 
    compile 'commons-io:commons-io:2.4' 
    compile 'com.google.android.gms:play-services-analytics:10.2.1' 
    compile project(":adjust") 
} 

这是错误消息:

Error:Execution failed for task ':app:packageAllReleaseClassesForMultiDex'. 
> java.util.zip.ZipException: duplicate entry: com/google/android/gms/iid/zzb$zza$zza.class 
+0

您应该尝试更新'com.google.android.gms:play-services-gcm:8.3.0'以与相同版本的'com.google.android.gms:play-服务分析:10.2.1' –

+0

谢谢。但我遵循了你的方向,'GoogleCloudMessaging'不起作用。 – user6191333

+0

它会给你一个特定的错误吗? –

回答

0

在普通的摇篮,你在寻找什么可以实现为:

dependencies { 
    compile('com.example.m:m:1.0') { 
    exclude group: 'org.unwanted', module: 'x 
    } 
    compile 'com.example.l:1.0' 
} 

这会排除模块X与M的依赖关系,但是如果依赖于L,它仍会带来它。