Demo app android issue

Every time i tried to login in the app it shows me this error message

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.inscripts.cometchatpulse.demo, PID: 23305
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.inscripts.cometchatpulse.demo/com.inscripts.cometchatpulse.demo.Activity.CometChatActivity}: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.inscripts.cometchatpulse.demo. Make sure to call FirebaseApp.initializeApp(Context) first.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3121)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3264)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7091)
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)
Caused by: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.inscripts.cometchatpulse.demo. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@19.3.0:184)
at com.google.firebase.messaging.FirebaseMessaging.getInstance(com.google.firebase:firebase-messaging@@20.1.0:1)
at com.inscripts.cometchatpulse.demo.Helper.MyFirebaseMessagingService.subscribeUser(MyFirebaseMessagingService.java:50)
at com.inscripts.cometchatpulse.demo.Activity.CometChatActivity.onCreate(CometChatActivity.java:83)
at android.app.Activity.performCreate(Activity.java:7327)
at android.app.Activity.performCreate(Activity.java:7318)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1275)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3101)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3264)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7091)
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)

1 Like

Hey @alexbets

As our sample app contains push notification, it is mandatory to add google-services.json to run the sample app as mentioned in the README.md.

Apologies for the inconvenience caused. Please refer the updated sample app:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.