LocationUpdatesBackgroundKotlin: Got an exception: java.lang.IllegalArgumentException: com.google.android.gms.location.sample.locationupdatesbackgroundkotlin: Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
eriknyk opened this issue · comments
Erik Amaru Ortiz commented
Just cloned and start the app, and it crashed after grant all permission to have the app running in background.
Android version: 13
Device: Pixel 7
Complete stacktrace:
java.lang.IllegalArgumentException: com.google.android.gms.location.sample.locationupdatesbackgroundkotlin: 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:401)
at android.app.PendingIntent.getBroadcastAsUser(PendingIntent.java:671)
at android.app.PendingIntent.getBroadcast(PendingIntent.java:658)
at com.google.android.gms.location.sample.locationupdatesbackgroundkotlin.data.MyLocationManager$locationUpdatePendingIntent$2.invoke(MyLocationManager.kt:84)
at com.google.android.gms.location.sample.locationupdatesbackgroundkotlin.data.MyLocationManager$locationUpdatePendingIntent$2.invoke(MyLocationManager.kt:81)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
at com.google.android.gms.location.sample.locationupdatesbackgroundkotlin.data.MyLocationManager.getLocationUpdatePendingIntent(MyLocationManager.kt:81)
at com.google.android.gms.location.sample.locationupdatesbackgroundkotlin.data.MyLocationManager.startLocationUpdates(MyLocationManager.kt:105)
at com.google.android.gms.location.sample.locationupdatesbackgroundkotlin.data.LocationRepository.startLocationUpdates(LocationRepository.kt:90)
at com.google.android.gms.location.sample.locationupdatesbackgroundkotlin.viewmodels.LocationUpdateViewModel.startLocationUpdates(LocationUpdateViewModel.kt:39)
at com.google.android.gms.location.sample.locationupdatesbackgroundkotlin.ui.LocationUpdateFragment.updateStartOrStopButtonState$lambda-7$lambda-6(LocationUpdateFragment.kt:163)
at com.google.android.gms.location.sample.locationupdatesbackgroundkotlin.ui.LocationUpdateFragment.$r8$lambda$9n4rXu88ei3mYpUVVcLfgeiddVQ(Unknown Source:0)
at com.google.android.gms.location.sample.locationupdatesbackgroundkotlin.ui.LocationUpdateFragment$$ExternalSyntheticLambda0.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7506)
at android.view.View.performClickInternal(View.java:7483)
at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
at android.view.View$PerformClick.run(View.java:29357)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7884)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
DatuX commented
same here