Expected behavior
Wanted to open a .txt file out of various options I got, I decided to use the logcat app to open the .txt file since it supports it.
Actual behavior
but immediately I clicked on using logcat app the app crashes in the process of opening the .txt file.
- please note that following same steps cause different actions from various devices e.g empty data
tested from @knowledges device
- also one of the causes of the bug was permissions which was not present in the app
How to reproduce
- Download the logcat app from here
- start a recording after accepting to use clipboard
- stop the recording to get a
.txtfile - open it in saved logs
- save the file to the file manager with any desired name
- open the saved file from the file manager in the documents category
App crashes in the process of opening it with logcat!
- mobile: Infinix note 4
- Operating system: android 7.0
- version: 1.2.2
- file manager: infinix mobile default file manager, version 1.0
Recording Of The Bug
Logcat
FATAL EXCEPTION: main Process: com.dp.logcatapp, PID: 29341 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dp.logcatapp/com.dp.logcatapp.activities.SavedLogsViewerActivity}: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/file/124983 from pid=29341, uid=10314 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2724) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2789) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1527) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:203) at android.app.ActivityThread.main(ActivityThread.java:6251) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1073) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:934) Caused by: java.lang.SecurityException: Permission Denial: reading com.android.providers.media.MediaProvider uri content://media/external/file/124983 from pid=29341, uid=10314 requires android.permission.READ_EXTERNAL_STORAGE, or grantUriPermission() at android.os.Parcel.readException(Parcel.java:1683) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188) at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140) at android.content.ContentProviderProxy.query(ContentProviderNative.java:421) at android.content.ContentResolver.query(ContentResolver.java:537) at android.content.ContentResolver.query(ContentResolver.java:479) at com.dp.logcatapp.util.MyExtensionsKt.getFileNameFromUri(MyExtensions.kt:176) at com.dp.logcatapp.activities.SavedLogsViewerActivity.onCreate(SavedLogsViewerActivity.kt:25) at android.app.Activity.performCreate(Activity.java:6687) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2677) ... 9 more
Posted on Utopian.io - Rewarding Open Source Contributors