0
votes

I am trying to use Proguard in an android application which uses android library projects. And I use 'firebase cloude message' So, I add

project gradle:
classpath 'com.google.gms:google-services:3.0.0'

app gradle:
compile 'com.google.firebase:firebase-messaging:9.4.0'
apply plugin: 'com.google.gms.google-services'

proguard:
-keep class com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

then I run app. I get this error message.

Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForDebug'. java.io.IOException: Can't write [D:\WorkSpace\AndroidWorkSpace\SKP050\SKP050\app\build\intermediates\transforms\proguard\debug\jars\3\1f\main.jar] (Can't read [D:\WorkSpace\AndroidWorkSpace\SKP050\SKP050\app\build\intermediates\exploded-aar\com.google.android.gms\play-services-basement\9.4.0\jars\classes.jar(;;;;;;**/*.class)] (Duplicate zip entry [classes.jar:com/google/android/gms/common/internal/zzv$zza$zza.class]))

I don't know why I get this error..

1

1 Answers

0
votes

The reason there is any error is due to the "apply plugin: 'com.google.gms.google-services'"
I added it to the top of the file.

I changed the position at the bottom of the file.
Error disappeared.