Open localhorst opened 1 year ago
Seeing the exact same issue, with approx the same crash rate
Is there any update on this?
For us, this bug makes using this plugin unsustainable. We have decided to switch our app architecture to Capacitor because we don't know if the future of Cordova as a whole is stable.
Apparently there can be issues, where the token isn't generated yet by the FCM service, and this can creates crashes, in the token get method.
Its described here: https://stackoverflow.com/questions/50208426/android-fcm-java-io-ioexception-service-not-available-error-on-some-devices/53919064
its handled in the PushPlugin.kt
file
val token = try {
try {
Tasks.await(FirebaseMessaging.getInstance().token)
} catch (e: ExecutionException) {
throw e.cause ?: e
}
} catch (e: IllegalStateException) {
Log.e(TAG, formatLogMessage("Firebase Token Exception ${e.message}"))
null
} catch (e: ExecutionException) {
Log.e(TAG, formatLogMessage("Firebase Token Exception ${e.message}"))
null
} catch (e: InterruptedException) {
Log.e(TAG, formatLogMessage("Firebase Token Exception ${e.message}"))
null
}
But this seems to be a different exception, and is causing crashes in production
Bug Report
We are using a bugfix commit of this plugin in our Cordova app released for target SDK 31:
"@havesource/cordova-plugin-push": "git+https://github.com/havesource/cordova-plugin-push.git#326057995bf581c5a0c50712cf3a010e01297803"
Link: https://github.com/havesource/cordova-plugin-push/commit/326057995bf581c5a0c50712cf3a010e01297803
We needed the bugfix commit because we experienced background crashes according to #198
Unfortunately, with the current release, we have a relatively high crash rate (0.4- 0.5%) on Android. However, we cannot recreate the crashes. The crashes are spread across a wide variety of devices and Android versions.
The reason seems to be these two error messages: java.io.IOException: SERVICE_NOT_AVAILABLE java.io.IOException: TOO_MANY_REGISTRATIONS. Crashes seem to be related to this Plugin, as PushPlugin.kt is mentioned in the stack trace. According to a review on Google Play, a crash occurs when app is starting (and trying to register with FCM).
Expected Behaviour
No crashes of the app
Actual Behaviour
On some devices and Android versions (8 - 13) the app crashes, probably at startup
Reproduce Scenario (including but not limited to)
Not possible for us so far.
Steps to Reproduce
--
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Android 10 Android 11 Android 12 Android 13
(Android) Device Vendor (e.g. Samsung, HTC, Sony...)
cordova info
PrintoutSample Push Data Payload
(How can I export / debug a payload, e.g. from an emulator?)
Sample Code that illustrates the problem
--
Logs taken while reproducing problem
From Google Play Console:
Stacktrace 1:
Stacktrace 2: