I\'ve spent about three days now trying to solve a java error that\'s stopping me from finishing my chat app! And of course it\'s a firebase error! I\'m new to Android Developin
Add:
apply plugin: 'com.google.gms.google-services'
in your app gradle file
According to the docs:
As said in the docs:
Any FirebaseApp initialization must occur only in the main process of the app. Use of Firebase in processes other than the main process is not supported and will likely cause problems related to resource contention.
you need to initialize it not in the activity.
add an application class to your manifest example:
then do this:
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
FirebaseApp.initializeApp(this);
}
and remove the initialization from the activity. You need to initialize it in the application class which is the base class.