Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Push Notifications: "Default FirebaseApp is not initialized" exception

Discussion in 'Player Engagement' started by coSphinkx, May 8, 2023.

  1. coSphinkx


    Sep 11, 2019
    Hi! I'm using Unity 2021.3.17f1. New Android application was created, only unity-jar-resolver-1.2.176 and Push Notifications 3.0.1-pre.1 were installed. I took code from Push Notification Example.
    Token received well, but every remote notification produce an exception:

    Code (csharp):
    2. FATAL EXCEPTION: Firebase-Messaging-Intent-Handle
    3. Process:, PID: 10132
    4. java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process Make sure to call FirebaseApp.initializeApp(Context) first.
    5.     at
    6.     at
    7.     at
    8.     at
    9.     at
    10.     at
    11.     at$processIntent$0$EnhancedIntentService(
    12.     at$$Lambda$ Source:6)
    13.     at java.util.concurrent.ThreadPoolExecutor.runWorker(
    14.     at java.util.concurrent.ThreadPoolExecutor$
    15.     at
    16.     at
  2. VladS_Unity


    Unity Technologies

    Nov 18, 2022

    Thanks for getting in touch!

    Are you using the provided `PushNotificationExample.cs` sample script while testing out your app with Push Notifications? And, just to clarify, are you using the test tool in the Push Notifications settings page to send your remote notifications?

    Also, what Android version is your test device using?

    If you could provide us with a sample project that can replicate this issue, that would be appreciated.

    For now, I recommend trying these options:
    • Did the unity-jar-resolver pick up the dependencies required by the Push SDK? You can check by using the "Display Libraries" option, found under Assets > External Dependency Manager > Android Resolver > Display Libraries (check below image). The following line should be present within, under the "dependencies" block:

      implementation '' // Assets/Push Notifications/Editor/Android/PushSDKDependencies.xml:8

      If it hasn't, please verify if the "PushSDKDependencies.xml" file was generated under the "Assets/Push Notifications/Editor/Android" folder, then use the Dependency Manager's "Resolve" or "Force Resolve" options to make the resolver pick it up again.

    • If you do not require it for any other plugins, I recommend trying to uninstall the unity-jar-resolver. While the Push Notifications SDK does integrate with it, it does not require the External Dependency Manager to resolve it's own dependencies. In this scenario, enabling the "Custom Main Gradle Template" option under the Android Publishing settings might also help.

      Hope that helps!
  3. Jonathan-FourFats


    Apr 21, 2016
    I have the same error.

    installing the FirebaseMessaging.unitypackage from Google fixed it for me

    so i have both the unity's and FirebaseMessaging.unitypackage installed.

    Unity changed something to avoid Firebase duplicate dll errors.

    installing FirebaseMessaging.unitypackage broke iOS received a notification callback to fix that, remove Firebase folder in /plugins/iOS/
    Last edited: May 17, 2023