How To Fix Java.lang.runtimeexception On Android Studio?
Solution 1:
From the docs:
For a vast majority of apps,
FirebaseInitProvider
will handle the initialization of Firebase for the default project that it's configured to work with, via the data contained in the app'sgoogle-services.json
file.In the event that an app requires access to another Firebase project in addition to the default project,
initializeApp(Context, FirebaseOptions, String)
must be used to create that relationship programmatically.
If you are using this app in two different projects then you need to use initializeApp()
.
https://firebase.google.com/docs/reference/android/com/google/firebase/FirebaseApp
Also update your Google service version to 4.2.0
as 4.1.0
had configuration issues.
classpath 'com.google.gms:google-services:4.2.0'
Solution 2:
Add apply plugin: 'com.google.gms.google-services' at the end of app gradle:
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'com.google.gms:google-services:4.2.0'
...
}
apply plugin: 'com.google.gms.google-services'
Post a Comment for "How To Fix Java.lang.runtimeexception On Android Studio?"