cph-cachet / flutter-plugins

A collection of Flutter plugins developed by CACHET
537 stars 642 forks source link

Activity Recognition Flutter #248

Closed sajunt4 closed 3 years ago

sajunt4 commented 3 years ago

Remember to specify the plugin name in the title!

Device / Emulator and OS

Please complete the following information for each phone and/or emulator you're experiencing this bug on:

NB: Bugs pertaining to old devices/OS versions will likely not be fixed.

Describe the bug

The app crashes when listening to activityStream

To Reproduce

Just call ActivityRecognition.activityStream(_).listen()

Expected behavior

Do not crash the app

Actual behavior

It crashes the app and leaves the following error: java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter key E/AndroidRuntime(27960): at dk.cachet.activity_recognition_flutter.activity.ActivityClient.onSharedPreferenceChanged(Unknown Source:7) E/AndroidRuntime(27960): at android.app.SharedPreferencesImpl$EditorImpl.notifyListeners(SharedPreferencesImpl.java:629) E/AndroidRuntime(27960): at android.app.SharedPreferencesImpl$EditorImpl.lambda$notifyListeners$0$SharedPreferencesImpl$EditorImpl(SharedPreferencesImpl.java:643) E/AndroidRuntime(27960): at android.app.-$$Lambda$SharedPreferencesImpl$EditorImpl$3CAjkhzA131V3V-sLfP2uy0FWZ0.run(Unknown Source:4) E/AndroidRuntime(27960): at android.os.Handler.handleCallback(Handler.java:938) E/AndroidRuntime(27960): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(27960): at android.os.Looper.loop(Looper.java:223) E/AndroidRuntime(27960): at android.app.ActivityThread.main(ActivityThread.java:7660) E/AndroidRuntime(27960): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(27960): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) E/AndroidRuntime(27960): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

Screenshots

If applicable, add screenshots to help explain your problem.

Flutter doctor

[√] Flutter (Channel stable, 1.22.4, on Microsoft Windows [Version 10.0.19042.423], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.2) [!] Android Studio (version 4.1.0) X Flutter plugin not installed; this adds Flutter specific functionality. X Dart plugin not installed; this adds Dart specific functionality. [√] VS Code (version 1.51.1) [√] Connected device (1 available)

Additional information

Add any other info about the problem here.

thomasnilsson commented 3 years ago

Please state the version. If you are not using version 2.0.2, we suggest you try that first