privacy-codelab icon indicating copy to clipboard operation
privacy-codelab copied to clipboard

Crashed on Android 7

Open hahn opened this issue 2 years ago • 0 comments

it's crashed on Android 7.

FATAL EXCEPTION: main
Process: com.example.photogood, PID: 26746
java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media from pid=26746, uid=10172 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
 at android.os.Parcel.readException(Parcel.java:1701)
 at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:183)
 at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:135)
 at android.content.ContentProviderProxy.query(ContentProviderNative.java:421)
 at android.content.ContentResolver.query(ContentResolver.java:536)
 at android.content.ContentResolver.query(ContentResolver.java:478)
 at com.example.photolog_end.MediaRepository$fetchImages$1.invokeSuspend(MediaRepository.kt:55)
 at com.example.photolog_end.MediaRepository$fetchImages$1.invoke(MediaRepository.kt)
 at com.example.photolog_end.MediaRepository$fetchImages$1.invoke(MediaRepository.kt)
 at kotlinx.coroutines.flow.SafeFlow.collectSafely(Builders.kt:61)
 at kotlinx.coroutines.flow.AbstractFlow.collect(Flow.kt:230)
 at com.example.photolog_end.AddLogViewModel$loadLocalPickerPictures$1$invokeSuspend$$inlined$map$1.collect(SafeCollector.common.kt:113)
 at kotlinx.coroutines.flow.FlowKt__CollectionKt.toCollection(Collection.kt:26)
 at kotlinx.coroutines.flow.FlowKt.toCollection(Unknown Source)
 at kotlinx.coroutines.flow.FlowKt__CollectionKt.toList(Collection.kt:15)
 at kotlinx.coroutines.flow.FlowKt.toList(Unknown Source)
 at kotlinx.coroutines.flow.FlowKt__CollectionKt.toList$default(Collection.kt:15)
 at kotlinx.coroutines.flow.FlowKt.toList$default(Unknown Source)
 at com.example.photolog_end.AddLogViewModel$loadLocalPickerPictures$1.invokeSuspend(AddLogViewModel.kt:157)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.internal.DispatchedContinuationKt.resumeCancellableWith(DispatchedContinuation.kt:367)
 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(Unknown Source)
 at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:47)
 at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source)
 at com.example.photolog_end.AddLogViewModel.loadLocalPickerPictures(AddLogViewModel.kt:156)
 at com.example.photolog_end.AddLogScreenKt$AddLogScreen$8$4$1$3$1$1$1.invoke(AddLogScreen.kt:289)
 at com.example.photolog_end.AddLogScreenKt$AddLogScreen$8$4$1$3$1$1$1.invoke(AddLogScreen.kt:288)
 at com.example.photolog_end.AddLogScreenKt.AddLogScreen$canAddPhoto(AddLogScreen.kt:108)
 at com.example.photolog_end.AddLogScreenKt.access$AddLogScreen$canAddPhoto(AddLogScreen.kt:1)
 at com.example.photolog_end.AddLogScreenKt$AddLogScreen$8$4$1$3$1$1.invoke(AddLogScreen.kt:288)
 at com.example.photolog_end.AddLogScreenKt$AddLogScreen$8$4$1$3$1$1.invoke(AddLogScreen.kt:287)
 at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$2.invoke-k-4lQ0M(Clickable.kt:153)
 at androidx.compose.foundation.ClickableKt$clickable$4$gesture$1$2.invoke(Clickable.kt:142)
 at androidx.compose.foundation.gestures.TapGestureDetectorKt$detectTapAndPress$2$1$1.invokeSuspend(TapGestureDetector.kt:222)
 at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
 at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:178)
 at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
 at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:397)

hahn avatar Feb 17 '23 13:02 hahn