[3.0.1] CARP_BACKGROUND_LOCATION - App crash after reset
Device / Emulator and OS
Please complete the following information for each phone and/or emulator you're experiencing this bug on:
- Device: Pixel 4
- OS: Android 11
Describe the bug
When I restart the emulator if the app was open It will crash and I will get this message in screen: Your_application keeps stoping
Error in console: E/AndroidRuntime( 9138): Process: com.example.mapa_fluttergt_google, PID: 9138 E/AndroidRuntime( 9138): java.lang.RuntimeException: Unable to start receiver rekab.app.background_locator.BootBroadcastReceiver: kotlin.TypeCastException: null cannot be cast to non-null type kotlin.String E/AndroidRuntime( 9138): at android.app.ActivityThread.handleReceiver(ActivityThread.java:4041) E/AndroidRuntime( 9138): at android.app.ActivityThread.access$1400(ActivityThread.java:237) E/AndroidRuntime( 9138): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1924) E/AndroidRuntime( 9138): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime( 9138): at android.os.Looper.loop(Looper.java:223) E/AndroidRuntime( 9138): at android.app.ActivityThread.main(ActivityThread.java:7656) E/AndroidRuntime( 9138): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime( 9138): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) E/AndroidRuntime( 9138): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) E/AndroidRuntime( 9138): Caused by: kotlin.TypeCastException: null cannot be cast to non-null type kotlin.String E/AndroidRuntime( 9138): at rekab.app.background_locator.BackgroundLocatorPlugin$Companion.startIsolateService(BackgroundLocatorPlugin.kt:104) E/AndroidRuntime( 9138): at rekab.app.background_locator.BackgroundLocatorPlugin$Companion.registerAfterBoot(BackgroundLocatorPlugin.kt:205) E/AndroidRuntime( 9138): at rekab.app.background_locator.BootBroadcastReceiver.onReceive(BootBroadcastReceiver.kt:10) E/AndroidRuntime( 9138): at android.app.ActivityThread.handleReceiver(ActivityThread.java:4032) E/AndroidRuntime( 9138): ... 8 more I/Process ( 9138): Sending signal. PID: 9138 SIG: 9 Lost connection to device.
To Reproduce
Run in powershell or another console the following command: adb shell am broadcast -a android.intent.action.BOOT_COMPLETED -p com.example.mapa_fluttergt_google
Expected behavior
I was hoping that the service of the application would keep running and I could see the notification just like the one seen in the screenshot before crashing
Actual behavior
App crashed and I got the erros log
Screenshots

Flutter doctor
Doctor summary (to see all details, run flutter doctor -v): [√] Flutter (Channel stable, 2.5.3, on Microsoft Windows [Versión 10.0.19043.1348], locale es-MX) [√] Android toolchain - develop for Android devices (Android SDK version 31.0.0) [√] Chrome - develop for the web [√] Android Studio (version 2020.3) [√] VS Code (version 1.63.1) [√] Connected device (3 available)
• No issues found!