I recently updated to Gradle Plugin 3.3.0
with Android Studio 3.3 and I'm getting this error:
io.reactivex.exceptions.OnErrorNotImplementedException: Default FirebaseApp is not initialized in this process <package-name>. Make sure to call FirebaseApp.initializeApp(Context) first.
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
However, it was working fine with AGP 3.2.0
Rest of my configuration is as follows:
Top level build.gradle
file:
buildscript {
...
ext.kotlin_version = '1.3.11'
ext.firebase_core = "16.0.6"
ext.firebase_messaging = "17.3.4"
ext.google_services_plugin_version = "4.1.0"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
...
classpath "com.google.gms:google-services:$google_services_plugin_version" // google-services plugin
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
...
}
...
App build.gradle
file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply plugin: "androidx.navigation.safeargs"
android {
...
}
configurations {
...
}
dependencies {
...
//firebase
implementation "com.google.firebase:firebase-core:$firebase_core"
implementation "com.google.firebase:firebase-messaging:$firebase_messaging"
...
}
apply plugin: 'com.google.gms.google-services'
It seems AGP 3.3.0
is incompatible with these Firebase versions. What can I do to resolve this issue? I updated AGP 3.3.0
because I want to use R8 to resolve an proguard issue.