EAndroidRuntime FATAL EXCEPTION main Process compokketwalletcashloangoloancashgo PID 819 javalangIllegalStateException Default FirebaseApp is not initialized in this process compokketwalletcashl
The error message indicates that the FirebaseApp is not initialized in the specified process. The app needs to call FirebaseApp.initializeApp(Context) first before calling FirebaseMessaging.getInstance().
In this specific case, the error occurred in MainActivity.java at line 143 where uploadFirebaseToken() is called. The method is trying to get an instance of FirebaseMessaging without initializing FirebaseApp first.
To fix this error, add the following line of code in the onCreate() method of MainActivity.java before calling uploadFirebaseToken():
FirebaseApp.initializeApp(this);
This initializes the default FirebaseApp in the current context, allowing FirebaseMessaging.getInstance() to work properly.
原文地址: https://www.cveoy.top/t/topic/0dW 著作权归作者所有。请勿转载和采集!