project information
repositories: https://github.com/danielmaxim95/Me
issues: https://github.com/danielmaxim95/Me/issues/1
EXPECTED BEHAVIOR
this application should work properly and can upload photos properly without causing the application to crash
ACTUAL BEHAVIOR
when I tried to upload photos, the application crashed, and the selected photos were not uploaded
STEP TO REPRODUCE
- install and open the app
- chose the day
- write the note
- click on red page the upload the pic
- see error
DEVICE ANDROID 6.1
APP NAME: ME
BUG RECORDING
LOG CAT
Process: com.maxd.me, PID: 18110
java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { dat=content://media/external/images/media/21480 }} to activity {com.maxd.me/com.maxd.me.DayActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/21480 from pid=18110, uid=10167 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.app.ActivityThread.deliverResults(ActivityThread.java:3859)
at android.app.ActivityThread.handleSendResult(ActivityThread.java:3902)
at android.app.ActivityThread.access$1300(ActivityThread.java:182)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1523)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loop(Looper.java:218)
at android.app.ActivityThread.main(ActivityThread.java:5657)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:990)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:785)
Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/images/media/21480 from pid=18110, uid=10167 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission()
at android.os.Parcel.readException(Parcel.java:1546)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:153)
at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:691)
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1113)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:937)
at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:794)
at android.content.ContentResolver.openFileDescriptor(ContentResolver.java:749)
at com.maxd.me.DayActivity.getBitmapFromUri(DayActivity.kt:248)
at com.maxd.me.DayActivity.onActivityResult(DayActivity.kt:234)
at android.app.Activity.dispatchActivityResult(Activity.java:6337)
at android.app.ActivityThread.deliverResults(ActivityThread.java:3855)
... 10 more```