question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Default FirebaseApp is not initialized in this process

See original GitHub issue

I sending push notification node-gcm to my token. Yey i have token. .configure({ }) is working. But the application crashes directly when I use the plugin and throw notification. This time I’m sending it again after the crash comes notification. When I try for the 3rd time, the app doesn’t come crashed.

Everyone said check xml file. I couldn’t find my fault. I think the readme.md file should be given piece by piece information about the xml file

For example; For Local Notification ... For GCM ... For FCM ...

RN Version: 0.60.4 OS: Android OS Version: 9 Plugin Version: lastest

AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.localreminder.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
...
<meta-data  android:name="com.dieam.reactnativepushnotification.notification_channel_name"
        android:value="YOUR NOTIFICATION CHANNEL NAME"/>
<meta-data  android:name="com.dieam.reactnativepushnotification.notification_channel_description"
            android:value="YOUR NOTIFICATION CHANNEL DESCRIPTION"/>
<meta-data  android:name="com.dieam.reactnativepushnotification.notification_color"
            android:resource="@android:color/white"/>
<receiver
    android:name="com.google.android.gms.gcm.GcmReceiver"
    android:exported="true"
    android:permission="com.google.android.c2dm.permission.SEND" >
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
        <category android:name="com.localreminder" />
    </intent-filter>
</receiver>

<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
<receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
</receiver>
<service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService"/>
<service
    android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerServiceGcm"
    android:exported="false" >
    <intent-filter>
        <action android:name="com.google.android.c2dm.intent.RECEIVE" />
    </intent-filter>
</service>

Error

java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.localreminder. Make sure to call FirebaseApp.initializeApp(Context) first.
	at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@17.1.0:186)
	at com.google.firebase.messaging.MessagingAnalytics.zza(com.google.firebase:firebase-messaging@@19.0.1:75)
	at com.google.firebase.messaging.MessagingAnalytics.logNotificationReceived(com.google.firebase:firebase-messaging@@19.0.1:2)
	at com.google.firebase.messaging.FirebaseMessagingService.zzc(com.google.firebase:firebase-messaging@@19.0.1:50)
	at com.google.firebase.messaging.zzg.run(com.google.firebase:firebase-messaging@@19.0.1:2)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at com.google.android.gms.common.util.concurrent.zza.run(Unknown Source:6)
	at java.lang.Thread.run(Thread.java:764)


Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13

github_iconTop GitHub Comments

306reactions
arqexcommented, Apr 30, 2020

I stumbled upon the same problem in android, and I was only using local notifications.

Seems that firebase is called when configuring the library with requestPermissions: true.

This fixed the problem for me:

PushNotification.configure({
//...
 requestPermissions: Platform.OS === 'ios'
//...
}
5reactions
Dallas62commented, Apr 30, 2020

Hi @arqex Thanks for sharing this! It’s a good way to avoid crash for Android when you are not using Firebase 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Default FirebaseApp is not initialized - android - Stack Overflow
We're seeing a few exceptions with the message Default FirebaseApp is not initialized in this process com.example.app. Make sure to call FirebaseApp.
Read more >
How can I fix 'Default FirebaseApp is not initialized in ... - MSDN
1.Package name in AndroidManifest.xml is identical to one in the google-services.json ; 2. google-services.json build action is set to ...
Read more >
Default FirebaseApp is not initialized in this process. Make ...
The Firebase SDK should be initialised automatically on Android. I'd suggest checking your application's startup logs to make sure there aren't ...
Read more >
FirebaseApp is not initialized in this process. Make sure to call ...
Firebase – Default FirebaseApp is not initialized in this process. Make sure to call FirebaseApp.initializeApp(Context) first. firebasexamarinxamarin.forms.
Read more >
FirebaseApp is not initialized in this process com.example ...
[Solved]-Default FirebaseApp is not initialized in this process com.example.example. Make sure to call FirebaseApp.initializeApp(Context) first-kotlin.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found