-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LocationUpdatesService.startTracking -> android.app.ForegroundServiceStartNotAllowedException #66
Comments
Hi autokus, I haven't seen this before but I'll check with different projects (cc @luca-vz). |
I looked a little further into it and indeed we also have the error in our firebase. Note that it's not only a Samsung issue, but happens more often. |
Some more info about the error: https://stackoverflow.com/questions/70044393/fatal-android-12-exception-startforegroundservice-not-allowed-due-to-mallows
|
Hi ikbendewilliam Thank you for your attention on this issue. A week ago we uploaded an app upgrade with some lib and build lib upgrades: gradle-wrapper.properies: build.gradle: I don't know if it's because of that, but with the new version of our app, we haven't had any error reported by Google so far. I will inform you if we see the error again. |
Ah good to know! Thank you for sharing! |
Hi ikbendewilliam The exception has unfortunately occurred again. However, only 2x on a samsung r9q (Galaxy S21 FE 5G), Android 13 (SDK 33). I did not specify any permission for foreground and background service in my AndroidManifest.xml. I saw that this was done in the lib itself. Am I correct there, I do not need to specify anything? In the doc for the plugin it says something about iOS configuration but nothing about Android. |
Hi @autokus <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" /> |
First of all, thank you for this plugin, on my experiance it works very well.
But I see such exceptions in the Google Play console. I can't reproduce this and I have no idea how I can fix it.
Exception java.lang.RuntimeException:
at android.app.ActivityThread.handleCreateService (ActivityThread.java:5086)
at android.app.ActivityThread.-$$Nest$mhandleCreateService
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2428)
at android.os.Handler.dispatchMessage (Handler.java:106)
at android.os.Looper.loopOnce (Looper.java:226)
at android.os.Looper.loop (Looper.java:313)
at android.app.ActivityThread.main (ActivityThread.java:8762)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1067)
Caused by android.app.ForegroundServiceStartNotAllowedException:
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel (ForegroundServiceStartNotAllowedException.java:54)
at android.app.ForegroundServiceStartNotAllowedException$1.createFromParcel (ForegroundServiceStartNotAllowedException.java:50)
at android.os.Parcel.readParcelableInternal (Parcel.java:4787)
at android.os.Parcel.readParcelable (Parcel.java:4755)
at android.os.Parcel.createExceptionOrNull (Parcel.java:3018)
at android.os.Parcel.createException (Parcel.java:3007)
at android.os.Parcel.readException (Parcel.java:2990)
at android.os.Parcel.readException (Parcel.java:2932)
at android.app.IActivityManager$Stub$Proxy.startService (IActivityManager.java:6214)
at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1967)
at android.app.ContextImpl.startForegroundService (ContextImpl.java:1933)
at android.content.ContextWrapper.startForegroundService (ContextWrapper.java:839)
at com.icapps.background_location_tracker.service.LocationUpdatesService.startTracking (LocationUpdatesService.java)
at com.icapps.background_location_tracker.service.LocationUpdatesService.onCreate (LocationUpdatesService.java)
at android.app.ActivityThread.handleCreateService (ActivityThread.java:5073)
Devices / OS:
samsung xcoverpro (Android 12 (SDK 31))
samsung r9q (Android 13 (SDK 33))
samsung a42xq (Android 12 (SDK 31))
samsung dm3q (Android 13 (SDK 33))
Lib-Version: 1.4.1
Flutter-Version: 3.13.x (not 100% sure but I think 3.13.5)
The text was updated successfully, but these errors were encountered: