I'm seeing crashes in Crashlytics for most recent Firebase Remote Config (15.0.0)
Inside Application.onCreate FirebaseRemoteConfig.getInstance is called.
It produces crash:
Caused by java.lang.NullPointerException
Attempt to invoke virtual method 'void com.google.android.gms.internal.config.zzar.zzc(long)' on a null object reference
com.google.firebase.remoteconfig.FirebaseRemoteConfig. (Unknown Source)
com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance (Unknown Source)
com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance (Unknown Source)
==== app's part
by.stari4ek.config.ConfigFirebase. (ConfigFirebase.java:90)
Firebase version:
implementation "com.google.firebase:firebase-config:15.0.0"classpath 'com.google.gms:google-services:3.2.1'This is new issue introduced with 15.0.0. I didn't have it with previous versions
Devices (all are android tv):
I just took a look at the 15.0.0 proguard mapping:
com.google.firebase.remoteconfig.internal.Metadata -> com.google.android.gms.internal.config.zzar:
// ...
void setLastAppUpdateTime(long) -> zzc
I'll try to investigate more myself and then report this to the team.
FWIW, I'm getting the same crash after upgrading to 15.0.0
Odd question: how is it compared to #291? Is it more frequent?
Same crash after upgrading to 15.0.
We've found the source of this error and will include a fix in an upcoming (likely the next) release. I will update this thread whenever I get more information.
Is this already resolved?
@swapnilgt no, there has not been a release since 15.0.0 yet.
We also got a NPE from FirebaseRemoteConfig.getInstance since the upgrade to 15.0.0, but the stack trace looks different from the one posted above
Caused by java.lang.NullPointerException
Attempt to write to field 'long com.google.android.gms.internal.config.r.b' on a null object reference
com.google.firebase.remoteconfig.FirebaseRemoteConfig. (Unknown Source:1000)
com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance (Unknown Source)
com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance (Unknown Source)
@samtstern Is there a workaround we can employ while we wait? This is (by far) my number 1 crash right now, by volume.
@samtstern any update on this? As we are getting lots of many crashes due to this
Any updates ? getting the same error on LG G4 Stylus Android 6
There is a new version of Remote Config with version 15.0.2. I couldnt find any release note for it. Does this have fix for this issue?
Hi everyone, this should be fixed in version 15.0.2. Thank you all for reporting!
Still, I'm facing this issue with firebase-config:17.0.0
java.lang.RuntimeException: Unable to create application com.omly.customer.AppController.AppController: java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.remoteconfig.FirebaseRemoteConfig com.google.firebase.remoteconfig.RemoteConfigComponent.get(java.lang.String)' on a null object reference
Firebase version:
Hi @saravanamoorthyk I'm not sure this is the same issue. If your getInstance is failing it could be an issue with your Firebase configuration. If you create a new issue and provide some details on how you are using Remote Config in your case it will allow us to help a bit more.
Getting this error if direct boot is enabled. (everything is fine if it is outside of direct boot)
EDIT: Fixed via https://github.com/shadowsocks/shadowsocks-android/commit/44c4f79c3345a5c9d95a84e227c3317f5f8ab3bb.
I have also run into that issue, but on versions 16.4.1 and 18.0.0.
Initilizing Remote Config gives NullPointerException
Instead of instance, got NPE:
java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.firebase.remoteconfig.FirebaseRemoteConfig com.google.firebase.remoteconfig.RemoteConfigComponent.get(java.lang.String)' on a null object reference
at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(Unknown Source)
at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(Unknown Source)
MyApp (init of Firebase App):
```
public class MyApp extends Application
{
@Override
public void onCreate ()
{
super.onCreate();
FirebaseApp.initializeApp(this);
}
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
SplitCompat.install(this);
}
}
LoginActivty (Launch activity):
public class LoginActivity extends Activity
{
@Override
@AddTrace(name = "LoginActivity.onCreate", enabled = true)
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate (savedInstanceState);
FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.getInstance();
}
}
My app module gradle config:
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
useLibrary 'org.apache.http.legacy'
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/androidsupportmultidexversion.txt'
exclude 'androidsupportmultidexversion.txt'
exclude 'META-INF/ASL2.0'
exclude 'project.properties'
exclude 'META-INF/INDEX.LIST'
}
lintOptions {
checkReleaseBuilds false
abortOnError false
}
defaultConfig {
applicationId "********"
minSdkVersion 18
targetSdkVersion 28
multiDexEnabled true
versionCode ****
versionName "***"
vectorDrawables.useSupportLibrary true
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:3.0.1'
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
multiDexEnabled = true
}
debug {
multiDexEnabled = true
minifyEnabled = false
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
dynamicFeatures = [":****", ":****"]
dexOptions {
preDexLibraries = true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
repositories {
maven { url "https://dl.bintray.com/hani-momanii/maven" }
maven { url "https://github.com/omadahealth/omada-nexus/raw/master/release" }
mavenCentral()
google()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
maven { url "http://dl.bintray.com/waynejo/maven" }
maven { url "https://jitpack.io" }
}
//...
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation group: 'com.google.firebase', name: 'firebase-iid', version: '19.0.1'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-perf:18.0.1'
implementation 'com.google.firebase:firebase-config:16.4.1'
implementation 'com.google.android.play:core:1.6.1'
//...
testImplementation 'junit:junit:4.12'
}
```
@arseniy899 could you try using the latest version of firebase-config right now it is 18.0.0
@arseniy899 could you try using the latest version of
firebase-configright now it is18.0.0
@kroikie, I've already tried and mentioned it:
Firebase/Play Services SDK version: 16.4.1, 18.0.0 (tried both of version with no success)
@arseniy899 sorry I missed that. The error seems to suggest that there is a get(String) being called. Is your issue that you are getting an NPE when getting a Remote Config instance, or are you getting the NPE when you are trying to get a String from Remote Config?
Well, as in my example
FirebaseRemoteConfig remoteConfig = FirebaseRemoteConfig.getInstance();
all usage for now - only init (getting instance).
Using AS sources look-up, NPE being thrown here:
public static FirebaseRemoteConfig getInstance(FirebaseApp var0)
{
return ((RemoteConfigComponent)var0.get(RemoteConfigComponent.class)).get("firebase");
}
Calling it separately:
FirebaseApp app = FirebaseApp.initializeApp(context);
RemoteConfigComponent component = app.get(RemoteConfigComponent.class); // <- Component is NULL
if(component != null)
FirebaseRemoteConfig remoteConfig = component.get("firebase");
So, .get("firebase") gives NullPointerException with get(String) suggestion
@arseniy899 thanks for confirming, I'll investigate this further and report back here.
@arseniy899 thanks for confirming, I'll investigate this further and report back here.
Hello, thanks.
However, today I've noticed that Push-notification (FirebaseMessaging) also crashes with NPE:
java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.iid.FirebaseInstanceId.zza(java.lang.String)' on a null object reference
at com.google.firebase.messaging.FirebaseMessaging.subscribeToTopic(com.google.firebase:firebase-messaging@@19.0.1:15)
With the following example:FirebaseMessaging.getInstance ().subscribeToTopic ("updates");
So, getInstance returns NULL. Please, help me as I've already tried everything.
@arseniy899 thanks for confirming, I'll investigate this further and report back here.
I've finally managed to launch the app without exception!
Exception occurs if in AndroidManifest.xml tools:node="replace" being set in <application ...> tag
@arseniy899 thanks for letting us know, glad you got the solution.
@arseniy899 i have the same issue with you, and the firebase-config version is 17.0.0.
But i haven't tools:node="replace" in AndroidManifest.xml
@arseniy899 i have the same issue with you, and the
firebase-configversion is17.0.0.
But i haven'ttools:node="replace"inAndroidManifest.xml
Well, I've also have dynamic features in my app (ondemand). These modules require extending Application class with own one. Might be both of that affects. Do you have any modules in your project, especially dynamic features?
@arseniy899 i use react native for my project, it's hard to check whether those modules extending Application class.
@arseniy899 it may be worth filing an issue on the React Native Firebase repo. If you have more details specific to the native SDK then please file a new issue here.
We're having similar issues after upgrade to 18.0.0, the project is in Java/Kotlin (there is no React Native stuff). I'll try to upgrade to 19.0.0 and post my findings here. If the issue will persist in 19.0.0, I'll file a new ticket.
We are also facing same issue after upgrading to 18.0.0. We are not using react native. Neither we have set tools:node="replace" in <application ...> tag
But it's only happening on Android 9 and Android 10 devices
The issue has disappeared after we upgraded to 19.0.0.
We are also facing same issue after upgrading to 18.0.0. We are not using react native. Neither we have set tools:node="replace" in
<application ...>tag
Well, I haven't got access to Android 9 & 10 yet, so issue was connected not to android version, I think.
Maybe you can reopen issue?
We'll try 19.0.0 out. If it's not fixed. We'll reopen the issue.
Thanks everyone for the quick response
In 19.0.4, this issue still occurs.
I am also facing the same issue.
still facing the same issue with com.google.firebase:firebase-config:19.1.1
I had the same issue with com.google.firebase:firebase-config:19.1.2. In my case the problem only happend on release builds with R8 enabled. I was able to get it to work by adding the following to my proguard-rules.pro:
-keep class com.google.**
-keepclassmembers class com.google.**
I'm getting the same crash In 19.2.0
please help me.
Most helpful comment
Hi everyone, this should be fixed in version
15.0.2. Thank you all for reporting!