EddyVerbruggen / nativescript-plugin-firebase

:fire: NativeScript plugin for Firebase
https://firebase.google.com
MIT License
1.01k stars 441 forks source link

Gradle Duplicate Classes #1835

Open maddockst opened 3 years ago

maddockst commented 3 years ago

I have been using the OneSignal-Android-SDK for some time, successfully. However, today I tried to start using the nativescript-plugin-firebase and I cam across issues with duplicate classes being defined:

Execution failed for task ':app:checkDebugDuplicateClasses'.
Duplicate class com.google.android.gms.internal.firebase_messaging.zza found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzb found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzc found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzd found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zze found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzf found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzh found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzm found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzo found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzp found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzq found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzr found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.android.gms.internal.firebase_messaging.zzs found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)
Duplicate class com.google.firebase.iid.FirebaseInstanceIdReceiver found in modules jetified-firebase-iid-20.0.2-runtime.jar (com.google.firebase:firebase-iid:20.0.2) and jetified-firebase-messaging-22.0.0-runtime.jar (com.google.firebase:firebase-messaging:22.0.0)

After some investigation, it appears that nativescript-plugin-firebase is making use of firebase-iid. The OneSignal-Android-SDK however is making use of firebase-messaging. I'm guessing both classes provide a definition for com.google.android.gms.internal.firebase_messaging. I believe firebase-iid is deprecated in favour of firebase-messaging.

Is there any way of fixing this or will I have to wait until nativescript-plugin-firebase stops using firebase-iid?