Firebase Messaging and Android API level 17

Today I was trying to integrate my Andorid app with Firebase Cloud Messaging to provide push notifications functionallty.

I had to add the following dependency to my build.gradle file to make the FirebaseMessagingService abstract class available:

compile ''

Unfortunately I have got the following error message when trying to build the app:

Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> duplicate entry: com/google/android/gms/common/api/zza.class

It seems that the issue do not occur when you use API level 19 or higher as the minSdkVersion. However I need to have my application compatible with Android 4.2.2 which uses API level 17.

The solution was pretty simple, but I haven’t found any info about that in the documentation. It works like a charm after adding the firebase-core dependency:

compile '' // add this line
compile ''

The another option is to use some older version of firebase-messaging dependency:

compile ''
Posts created 16

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top