MoPub: TransformException - ZipException: duplicated entry when building on gradle

早过忘川 提交于 2019-12-12 03:36:19

问题


I'm trying to integrate MoPub into my app.

I imported the sdk into my app:

compile('com.mopub.sdk.android:mopub:4.4.1@aar') {
    transitive = true;
}

But an error is returned when I tried to build it.

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

com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzqq$zza.class

I have imported the com.google.android.gms llibrary into my app:

compile('com.google.android.gms:play-services-base:8.3.0') {
    exclude module: 'support-v4'
}
compile('com.google.android.gms:play-services-location:8.3.0') {
    exclude module: 'support-v4'
}
compile('com.google.android.gms:play-services-gcm:8.3.0') {
    exclude module: 'support-v4'
}
compile('com.google.android.gms:play-services-maps:8.3.0') {
    exclude module: 'support-v4'
}
compile('com.google.android.gms:play-services-appinvite:8.3.0') {
    exclude module: 'support-v4'
}
compile('com.google.android.gms:play-services-analytics:8.3.0') {
    exclude module: 'support-v4'
}

So I thought I would exclude them from the sdk:

compile('com.mopub.sdk.android:mopub:4.4.1@aar') {
    exclude group: 'com.google.android.gms'
}

Still doesn't work.

Then I tried to remove transitive:

compile('com.mopub.sdk.android:mopub:4.4.1@aar')

Still doesn't work.

How do I get this MoPub sdk to integrate successfully into my android app?


回答1:


Actually I found the answer.

I'm trying to use the facebook audience network sdk and that sdk was the one that caused the conflict - doing this in the facebook audience network sdk caused the app to compile again.

compile ('com.facebook.android:audience-network-sdk:4.+') {
    exclude group: 'com.google.android.gms'
}


来源:https://stackoverflow.com/questions/36163756/mopub-transformexception-zipexception-duplicated-entry-when-building-on-grad

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!