HaylLtd/cordova-background-geolocation-plugin

FLAG_MUTABLE with latest version

Closed this issue · 2 comments

Describe the bug
A clear and concise description of what the bug is.

Desktop (please complete the following information):

  • OS: Window 10
  • Browser Chrome
  • Version 2.0.7, Android 12, Cordova Android 11.0.0

Expected behavior
2022-12-19 13:08:49.201 17415-17415/io.cordova.routingapp E/com.marianhello.bgloc.service.LocationServiceImpl: processCommand: exceptionjava.lang.IllegalArgumentException: io.cordova.routingapp: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
Strongly consider using FLAG_IMMUTABLE, only use FLAG_MUTABLE if some functionality depends on the PendingIntent being mutable, e.g. if it needs to be used with inline replies or bubbles.
at android.app.PendingIntent.checkFlags(PendingIntent.java:378)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:648)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:635)
at com.marianhello.bgloc.provider.ActivityRecognitionLocationProvider.onCreate(ActivityRecognitionLocationProvider.java:52)
at com.marianhello.bgloc.service.LocationServiceImpl.start(LocationServiceImpl.java:359)
at com.marianhello.bgloc.service.LocationServiceImpl.processCommand(LocationServiceImpl.java:306)
at com.marianhello.bgloc.service.LocationServiceImpl.onStartCommand(LocationServiceImpl.java:288)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4807)
at android.app.ActivityThread.access$2100(ActivityThread.java:254)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2222)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:344)
at android.app.ActivityThread.main(ActivityThread.java:8212)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)

Are you using the latest version?
You'll need to debug and see what went wrong, we are not going to see that for you...

i fixed it. ty so much. Please ignore this bug