carp-dk / carp-dk/flutter-plugins
Activity Recognition crashes on android 12
- Dominant language
- Dart
- Stars
- 608
- Forks
- 735
- Avg merge
- 1m
- Merged PRs (30d)
- 3
Description
**Remember to specify the plugin name in the title!**
### Device / Emulator and OS
- Device: pixel 3a emulator
- OS: [e.g. iOS 13.1]
### Describe the bug
when the activity recognition stream starts, it causes the app to crash, specifically on android 12.
All permissions are given before starting the stream yet this still happens. Did not face an issue with other android devices.
### To Reproduce
1. running the app
2. starting the activity stream
### Expected behavior
the stream starts and the activity is recognized
### Actual behavior
the app crashes
```
FATAL EXCEPTION: AsyncTask #1
E/AndroidRuntime( 7605): Process: com.oryx.falcon_flex_driver, PID: 7605
E/AndroidRuntime( 7605): java.lang.RuntimeException: An error occurred while executing doInBackground()
E/AndroidRuntime( 7605): at android.os.AsyncTask$4.done(AsyncTask.java:415)
E/AndroidRuntime( 7605): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:383)
E/AndroidRuntime( 7605): at java.util.concurrent.FutureTask.setException(FutureTask.java:252)
E/AndroidRuntime( 7605): at java.util.concurrent.FutureTask.run(FutureTask.java:271)
E/AndroidRuntime( 7605): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
E/AndroidRuntime( 7605): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
E/AndroidRuntime( 7605): at java.lang.Thread.run(Thread.java:920)
E/AndroidRuntime( 7605): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List com.google.android.gms.location.ActivityRecognitionResult.getProbableActivities()' on a null object reference
E/AndroidRuntime( 7605): at dk.cachet.activity_recognition_flutter.ActivityRecognizedService.onHandleIntent(ActivityRecognizedService.java:36)
E/AndroidRuntime( 7605): at dk.cachet.activity_recognition_flutter.ActivityRecognizedService.onHandleWork(ActivityRecognizedService.java:30)
E/AndroidRuntime( 7605): at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:396)
E/AndroidRuntime( 7605): at androidx.core.app.JobIntentService$CommandProcessor.doInBackground(JobIntentService.java:387)
E/AndroidRuntime( 7605): at android.os.AsyncTask$3.call(AsyncTask.java:394)
E/AndroidRuntime( 7605): at java.util.concurrent.FutureTask.run(FutureTask.java:266)
E/AndroidRuntime( 7605): ... 3 more
```
### Flutter doctor
```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on macOS 11.6 20G165 darwin-arm, locale en-QA)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.2.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.2)
[✓] Connected device (2 available)
• No issues found!
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.