Push - failed to register - firebase already register [SOLVED]

#1

Hi,

can’t make push notification working.

Android Error : E/push: Failed to register java.lang.IllegalStateException: FirebaseApp name [DEFAULT] already exists! at com.google.android.gms.common.internal.Preconditions.checkState(Unknown Source:29) at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.2:350) at com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.0.2:324) at com.defold.push.Push.registerFirebase(Push.java:348) at com.defold.push.Push.startFirebase(Push.java:378) at com.defold.push.Push.access$200(Push.java:54) at com.defold.push.Push$1.run(Push.java:177) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7050) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)

and
E/defold: ERROR:PUSHEXTEXTERNAL: HandleRegistrationResult: FirebaseApp name [DEFAULT] already exists!

Dependencies :

I tryied without https://github.com/defold/extension-firebase-analytics/archive/1.3.2.zip
but same error.

0 Likes

#3

update, I removed all ‘google’ stuff dependencies : admob, google plys service and firebase librairies,
I still have the same trouble here

any idea ?

0 Likes

#4

Please check how many times you call .initializeApp( method in your native extensions.
Just search for this line .initializeApp( in your project and show me the result.

0 Likes

#5

just one

0 Likes

#6

Ok, then show me code where you call push.register
It seems like you call it more than once.

1 Like

#7


0 Likes

#8

And, is the push.register() function being called more than once?
Put a print(message_id) at the top of the on_message function.

0 Likes

#9

I see only one debug info


1 Like

#10

up, any idea ? :confused:

0 Likes

#11

I will investigate it as soon as I’ve completed my current task (Android Billing 3.0 upgrade). I should be done by tomorrow or the latest Friday.

Could I please ask you to create a ticket in the extension-firebase repository?

1 Like

#12

thanks!

good luck with 3.0, of course I can create the ticket

0 Likes

#13

I wasn’t able to find a ticket.

I’ve done quite a bit of testing today and found some issues on Android regarding how Firebase is initialized. I don’t believe the current setup would work very well in combination with other Firebase extensions such as extension-firebase-analytics.

I’ve created a PR that is waiting for review: https://github.com/defold/extension-push/pull/22

0 Likes

#14

The PR has been merged and a new release has been made: https://github.com/defold/extension-push/releases/tag/2.0.0

You now configure push on Android the same way as any other Firebase project; through the Firebase Console and the google-services.json config file.

0 Likes

#15

Hi,
thanks for the fix and updates, and sorry for the delay, big rush at work (got my own digital agency, crazy times…)
i’ll test during my free time soon

1 Like

#16

Hi,

not sure it’s related but i’ve this error :

I tried to remove the dependencie, fetch then add again, but same error.
I also remove .internal and build folders but same.

any idea ?

thanks

0 Likes

#17

same error with others dependencies btw

0 Likes

#18

Which version of the editor are you using?

0 Likes

#19

my bad I was on the beta.

it seems to work with stable release.

I’m build now to test notifications. thanks

0 Likes

#20

it works fine! thank you!

1 Like

#21

Good to hear!

0 Likes