firebase / firebase/firebase-android-sdk
RemoteConfigComponent and FirebaseMessaging return null for some users
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 710
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 31
Description
### Step 2: Describe your environment
* Android Studio version: Android Studio Iguana
* Firebase Component: Messaging & Config
* Component version: Firebase BOM 32.7.0
### [REQUIRED] Step 3: Describe the problem
https://github.com/firebase/firebase-android-sdk/blob/5ef5cdda14666df3f6727719f4d3344c8286ef32/firebase-config/src/main/java/com/google/firebase/remoteconfig/FirebaseRemoteConfig.java#L87
The code block above returns null for about ~1,500 users a day when we attempt to configure RemoteConfig. We are forced to check if `RemoteConfigComponent` is available before calling the config-ktx helper function:
```
firebase.get(RemoteConfigComponent::class.java) != null
```
and when we dont we see the following crash in production.
```
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'dbxyzptlk.h41.g dbxyzptlk.h41.k.d()' on a null object reference
at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(FirebaseRemoteConfig.java:86)
at com.google.firebase.remoteconfig.ktx.RemoteConfigKt.remoteConfig(RemoteConfig.kt:32)
```
We also see the same behavior when it comes to getting the FirebaseMessaging and do a similar check:
```
firebase.get(FirebaseMessaging::class.java) != null
```
I do see the `ComponentDiscoveryService` have the Registrars populated for Messaging and RemoteConfig as well:

Contributor guide
Assessment
This issue has not been assessed yet.