You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Library Version [e.g. "com.android.application" ,v8.1.2]
Affected Device(s) [e.g. Samsung Galaxy s10 with Android 9.0]
Describe the Bug:
SecurityException -> when i get photo image from "Photo Picker"
[ why don't you add this code]
// Check and request permissionsif (ContextCompat.checkSelfPermission(
this,
Manifest.permission.READ_EXTERNAL_STORAGE
) !=PackageManager.PERMISSION_GRANTED
) {
// Permission is not granted, request itActivityCompat.requestPermissions(
this,
arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),
REQUEST_CODE_READ_EXTERNAL_STORAGE
)
} else {
// Permission already granted, proceed with accessing the URI
}
Process: com.google.android.samples.socialite, PID: 8183java.lang.SecurityException: No persistable permission grants found forUID10095 and Uricontent://media/external/file/24233 [user 0]
at android.os.Parcel.createException(Parcel.java:2088)
at android.os.Parcel.readException(Parcel.java:2056)
at android.os.Parcel.readException(Parcel.java:2004)
at android.app.IUriGrantsManager$Stub$Proxy.takePersistableUriPermission(IUriGrantsManager.java:280)
at android.content.ContentResolver.takePersistableUriPermission(ContentResolver.java:2442)
at com.google.android.samples.socialite.ui.photopicker.PhotoPickerViewModel$onPhotoPicked$1.invokeSuspend(PhotoPickerViewModel.kt:43)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:365)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable(Cancellable.kt:30)
at kotlinx.coroutines.intrinsics.CancellableKt.startCoroutineCancellable$default(Cancellable.kt:25)
at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:110)
at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:126)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:56)
at kotlinx.coroutines.BuildersKt.launch(UnknownSource:1)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
at kotlinx.coroutines.BuildersKt.launch$default(UnknownSource:1)
at com.google.android.samples.socialite.ui.photopicker.PhotoPickerViewModel.onPhotoPicked(PhotoPickerViewModel.kt:41)
at com.google.android.samples.socialite.ui.photopicker.navigation.PhotoPickerRouteKt$PhotoPickerRoute$photoPickerLauncher$1.invoke(PhotoPickerRoute.kt:38)
at com.google.android.samples.socialite.ui.photopicker.navigation.PhotoPickerRouteKt$PhotoPickerRoute$photoPickerLauncher$1.invoke(PhotoPickerRoute.kt:34)
at androidx.activity.compose.ActivityResultRegistryKt$rememberLauncherForActivityResult$1.invoke$lambda$0(ActivityResultRegistry.kt:106)
at androidx.activity.compose.ActivityResultRegistryKt$rememberLauncherForActivityResult$1.$r8$lambda$CrhP0xb3HsgP_dLwJEFAtzTwPms(UnknownSource:0)
at androidx.activity.compose.ActivityResultRegistryKt$rememberLauncherForActivityResult$1$$ExternalSyntheticLambda0.onActivityResult(UnknownSource:2)
at androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.java:414)
at androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.java:371)
at androidx.activity.ComponentActivity.onActivityResult(ComponentActivity.kt:777)
at android.app.Activity.dispatchActivityResult(Activity.java:8300)
at android.app.ActivityThread.deliverResults(ActivityThread.java:5353)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:5401)
at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2267)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(NativeMethod)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@9826215,Dispatchers.Main.immediate]
Causedby: android.os.RemoteException: Remote stack trace:
at com.android.server.uri.UriGrantsManagerService.takePersistableUriPermission(UriGrantsManagerService.java:332)
2023-12-2909:20:17.8478183-8183AndroidRuntime com...gle.android.samples.socialite E at android.app.IUriGrantsManager$Stub.onTransact(IUriGrantsManager.java:139)
at android.os.Binder.execTransactInternal(Binder.java:1056)
at android.os.Binder.execTransact(Binder.java:1029)
Expected Behavior:
A clear description of what you expected to happen.
The text was updated successfully, but these errors were encountered:
Please complete the following information:
Describe the Bug:
[ why don't you add this code]
Expected Behavior:
A clear description of what you expected to happen.
The text was updated successfully, but these errors were encountered: