iqbalmineraltown / flutter_sms_receiver

SMS Receiver API Flutter Plugin
BSD 3-Clause "New" or "Revised" License
22 stars 22 forks source link

Crashing devices on com.oval.sms_receiver.SMSBroadcastReceiver.onReceive #23

Closed Jai05-techie closed 2 years ago

Jai05-techie commented 2 years ago

Hi,

We have recently released a new version Android Application on Playstore. It's reported more crashes on Firebase Crashlytics in com.oval.sms_receiver.SMSBroadcastReceiver.onReceive. I'm using sms_receiver: ^0.4.1 plugin.

flutter doctor -v

[✓] Flutter (Channel stable, 2.8.1, on macOS 12.0.1 21A559 darwin-arm, locale
    en-IN)
    • Flutter version 2.8.1 at
      /Users/macbookair/Documents/developer/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 77d935af4d (8 weeks ago), 2021-12-16 08:37:33 -0800
    • Engine revision 890a5fca2e
    • Dart version 2.15.1

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
    • Android SDK at /Users/macbookair/Library/Android/sdk
    • Platform android-32, build-tools 32.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] Connected device (1 available)
    • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80

• No issues found!

Firebase Crash Log,

Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=com.google.android.gms.auth.api.phone.SMS_RETRIEVED flg=0x200010 pkg=com.examplepackage (has extras) } in c.h.a.a@cc353d5
       at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1629)
       at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(-.java:2)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:257)
       at android.app.ActivityThread.main(ActivityThread.java:8143)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
Caused by h.o: null cannot be cast to non-null type kotlin.String
       at com.oval.sms_receiver.SMSBroadcastReceiver.onReceive(SMSBroadcastReceiver.java:97)
       at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1619)
       at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(-.java:2)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:257)
       at android.app.ActivityThread.main(ActivityThread.java:8143)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)

Any solution ? Thanks in advance!

iqbalmineraltown commented 2 years ago

could you try to reproduce this in the local environment? also, could you provide more details on crashed devices? e.g. device type, android version

Jai05-techie commented 2 years ago

Hi @iqbalmineraltown here below attached screenshot of crashed devices from firebase.

Screenshot 2022-02-28 at 10 52 45 AM
iqbalmineraltown commented 2 years ago

thanks for the info! could you create a minimum reproduceable sample?

Jai05-techie commented 2 years ago

Hi @iqbalmineraltown in local environment i couldn't able to reproduce. I tried with emulator on same Operating System 11 doesn't crashed. It's happening in release build.

iqbalmineraltown commented 2 years ago

if we cannot reproduce the error on local, these might be specific to certain devices sorry but not much I can do about this