Android Proguard problems(duplicate) when adding F

2019-07-09 05:23发布

It builds ok but when I run it gets this error: it didn't happen until I add firebase

Warning:Exception while processing task java.io.IOException: Can't write [/var/android_projects/Aflam/Aflam/app/build/intermediates/transforms/proguard/debug/jars/3/1f/main.jar] (Can't read [/home/omar/.android/build-cache/7b35109bbea465da27464678b5f699568c4204d8/output/jars/classes.jar(;;;;;;**.class)] (Duplicate zip entry [classes.jar:com/google/android/gms/internal/zzw$zza.class]))

Proguard rules:
{

    -keep class org.apache.http.** { *; }
    -keep class com.google.android.gms.**

    -dontwarn com.google.android.gms.**
    -dontwarn com.google.ads.**
    -dontwarn org.apache.http.**
    -dontwarn android.net.**

    -dontnote com.google.android.gms.**
    -dontnote org.apache.http.**
    -dontnote com.android.net.http.**
    -dontnote android.net.**
}


dependencies {

    //compile fileTree(dir: 'libs', include: ['*.jar'])
    //testCompile 'junit:junit:4.12'
    compile ('com.facebook.android:audience-network-sdk:4.+') {
        exclude module: 'bolts-android'
        exclude module: 'support-v4'
    }
    compile(name:'unity-ads',ext:'aar')
    compile 'com.codemybrainsout.rating:ratingdialog:1.0.7'
    compile 'com.google.firebase:firebase-core:10.2.0'
    compile 'com.google.firebase:firebase-messaging:10.2.0'
}

1条回答
smile是对你的礼貌
2楼-- · 2019-07-09 05:55

It seems that play-services-ads has version 8.4.0 in audience-network-sdk module with dependencies to com.google.android.gms of lower version, exclude play-services-ads and add play-services-ads:10.2.0 afterwards :

dependencies {
    compile ('com.facebook.android:audience-network-sdk:4.+') {
        exclude module: 'play-services-ads'
    }
    compile(name:'unity-ads',ext:'aar')
    compile 'com.codemybrainsout.rating:ratingdialog:1.0.7'
    compile 'com.google.firebase:firebase-core:10.2.0'
    compile 'com.google.android.gms:play-services-ads:10.2.0'
}
查看更多
登录 后发表回答