Closed orenagiv closed 3 years ago
@orenagiv Thanks for using the plugin! Can you send me the environment details like Cordova, ionic and device version? it will help me to reproduce the issue. Thanks!
Hey @hanatharesh2712, Thanks for the quick response!
We're using Cordova 9.0.0 (not ionic). Cordova-android v8.1.0 is used.
The device versions that encountered this issue in our case are: Galaxy S10 | Android 10 Pixel 4 | Android 10 Galaxy S9 | Android 9 Galaxy A70 | Android 9 Galaxy S8 | Android 9 Galaxy S7 Edge | Android 8.0.0
Is there any other information you need?
Hey @hanatharesh2712, Did you get a chance to look at this one?
Thanks! Oren
Appeared to me also. 3 Times currently
@orenagiv @HansKrywaa I have tried to reproduce this issue with the environment you said. (with Ionic) and I can't reproduce this issue. I tried this on different emulators and a real Samsung device.
If you guys can have some specific steps to reproduce then It will be good to have for debugging. Thanks!
@hanatharesh2712 - i can't reproduce it voa steps, but crash still occurs. Isn't it possible to add a workaround by just checking if Receiver is registered?
@HansKrywaa I am already checking that onDestoy method. I will wrap unregister code in try-catch block to avoid crash.
@orenagiv @HansKrywaa I have updated the code and published the package. please try with installing the latest
I will use the Fix in our next Release and let you know if it happens again
Thanks @hanatharesh2712 ! I'll test and let you know.
Didn't happen for me again, what about you @orenagiv ?
Hey @HansKrywaa I couldn't reproduce it locally, and we haven't yet deployed a new release to production. However, we are going to release one within a few days - and then I'll monitor it and update you here.
Thanks for all your efforts! 👍
closing this as resolved. if you have still issues then open it again.
Hello, I have been testing these days the plugin with a cordova application and I am getting the same error message, I already have the latest version of the plugin where you added try catch.
Plugin : Cordova vesion 10.0.0. "cordova-android": "^9.1.0", cordova-plugin-sms-retriever-manager 1.0.3 "Device"
I try in android studio emulator
java.lang.IllegalArgumentException: Receiver not registered: com.codingsans.ionic.smsRetriever.AndroidSmsRetriever$3@cf10c27 at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:1435) 2022-04-06 16:48:20.885 4724-4724/W/System.err: at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1642) 2022-04-06 16:48:20.885 4724-4724/: at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:715) 2022-04-06 16:48:20.885 4724-4724/ W/System.err: at com.codingsans.ionic.smsRetriever.AndroidSmsRetriever.onDestroy(AndroidSmsRetriever.java:122)
I really appreciate your help
Hey,
In some cases a crash occurs (we don't have specific steps to reproduce):
Fatal Exception: java.lang.RuntimeException Unable to destroy activity {app.tabit.il_prd/app.tabit.il_prd.MainActivity}: java.lang.IllegalArgumentException: Receiver not registered: com.codingsans.ionic.smsRetriever.AndroidSmsRetriever$3@d15f808
It's caused by:
com.codingsans.ionic.smsRetriever.AndroidSmsRetriever.onDestroy (AndroidSmsRetriever.java:122)
It seems that onDestroy it tries to unregister, but if the receiver is not registered - it causes the app to crash.