Skip to content Skip to sidebar Skip to footer

Compile Time Error For SetServiceAccount() With FirebaseOptions.Builder()

I was working my Android app for sending push notifications using Firebase cloud messaging. I was setting up my server referring the guide https://firebase.google.com/docs/server/

Solution 1:

In your server project you need to use only the dependency:
com.google.firebase:firebase-server-sdk:[3.0.0,) and remove:

compile 'com.firebase:firebase-client-android:2.5.2'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'com.google.firebase:firebase-core:9.0.0'

The first is a server sdk while the others are client sdk and they will have conflicts if you try to use them together.


Solution 2:

You're including a different version of the Firebase Database SDK than what you have for the other Firebase features:

compile 'com.firebase:firebase-client-android:2.5.2'

If you change it to:

compile 'com.google.firebase:firebase-database:9.0.0'

It will work better.

For more information, see the Firebase documentation for Android developers, from where I copied the line above.


Post a Comment for "Compile Time Error For SetServiceAccount() With FirebaseOptions.Builder()"