mopub整合时出错

时间:2017-04-28 09:39:48

标签: java android mopub

我正在应用中集成 MOPUB广告。我正在关注 https://www.mopub.com/resources/docs/android-sdk-integration/android-getting-started/

中的 MOPUB SDK 集成步骤

添加mopub-volley-1.1.0.jar后,我收到了以下错误。

错误:任务':app:transformClassesWithJarMergingForDebug'的执行失败。 com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com / mopub / volley / AuthFailureError.class

我的build.gradle代码是

apply plugin: 'com.android.application'
android {
    compileSdkVersion 24
    buildToolsVersion '24.0.1'

    defaultConfig {
        multiDexEnabled true
        applicationId "com.mopubdemo.android"
        minSdkVersion 16
        targetSdkVersion 24
        versionCode 27
        versionName '2.05'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/plexus/components.xml'
   }
}

dependencies {
   compile files('libs/universal-image-loader-1.9.3.jar')
   compile files('libs/FlurryAnalytics-6.2.0.jar')
   compile files('libs/acra-4.6.1.jar')

   compile project(':mopub-sdk:mopub-sdk-native-video')
   compile project(':mopub-sdk:mopub-sdk-native-static')
   compile project(':mopub-sdk:mopub-sdk-banner')
   compile project(':mopub-sdk:mopub-sdk-rewardedvideo')
   compile project(':mopub-sdk')
   compile project(':mopub-sdk:mopub-sdk-interstitial')

   androidTestCompile 'junit:junit:4.12'
   compile 'com.android.support:multidex:1.0.1'
   compile 'com.github.johnkil.android-robototextview:robototextview:2.4.2'
   compile 'com.google.code.gson:gson:2.4'
   compile 'com.rengwuxian.materialedittext:library:2.1.4'
   compile 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
   compile 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
   compile 'com.nhaarman.listviewanimations:lib-core-slh:3.1.0@aar'
   compile 'org.ocpsoft.prettytime:prettytime:4.0.0.Final'
   compile 'com.koushikdutta.ion:ion:2.1.6'
   compile 'pub.devrel:easypermissions:0.1.5'
   compile 'com.android.support:appcompat-v7:24.2.1'
   compile 'com.android.support:cardview-v7:24.1.1'
   compile 'com.android.support:support-v4:24.1.1'
   compile 'com.android.support:recyclerview-v7:24.1.1'
   compile 'com.android.support:support-annotations:24.1.1'
   compile 'com.google.android.gms:play-services:10.2.1'

  compile files('libs/mopub-volley-1.1.0.jar')
}

1 个答案:

答案 0 :(得分:1)

删除此行,然后同步

compile files('libs/mopub-volley-1.1.0.jar')