-
Notifications
You must be signed in to change notification settings - Fork 574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FirebaseApp.UserUnlockReceiver.unregister crashes #5775
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Workaroundval context = object : ContextWrapper(this) {
override fun getApplicationContext(): ContextWrapper {
return this
}
override fun unregisterReceiver(receiver: BroadcastReceiver?) {
try {
super.unregisterReceiver(receiver)
} catch (_:IllegalArgumentException) {
}
}
}
FirebaseApp.initializeApp(context) EDIT: Maybe it won't be that easy. I got this log
|
Hi @consp1racy, thank you for reaching out. We appreciate you investigating the issue and providing the fix. I'll inform our engineers about this with your pull request. |
Hi @consp1racy thanks for reaching out, and providing a fix! I'll review the code and run the tests required to include it in the codebase. |
Steps to reproduce:
Crashlytics notified us about a crash in
FirebaseApp.UserUnlockReceiver.unregister
. The method is only called fromFirebaseApp.UserUnlockReceiver.onReceive
which in turn only responds toandroid.intent.action.USER_UNLOCKED
. I don't know how many times the system sends the broadcast but it apparently isn't just once.Relevant Code:
firebase-android-sdk/firebase-common/src/main/java/com/google/firebase/FirebaseApp.java
Lines 668 to 680 in b77c218
FirebaseApp
initialization may be idempotent butContext.unregisterReceiver
isn't. The method crashes if the receiver isn't registered.Suggested solution
The text was updated successfully, but these errors were encountered: