ARK-Builders / ARK-Navigator

Android app for navigation through your data
MIT License
15 stars 15 forks source link

App crashes after denying permission to access files #198

Closed melvin4u445 closed 2 years ago

melvin4u445 commented 2 years ago

Steps:

  1. Install the app and open it
  2. Deny access to files
  3. If the Plus button isn't visible in "Manage folders" section, then open "Navigate data" tab and switch back to "Manage folders" to see the plus button
  4. Tap the Plus button in "Manage folders" section
  5. A folder picker modal pops up. Try to open any folder in the modal
--------- beginning of crash
02-01 20:22:19.815 12870 12870 E AndroidRuntime: FATAL EXCEPTION: main
02-01 20:22:19.815 12870 12870 E AndroidRuntime: Process: space.taran.arknavigator, PID: 12870
02-01 20:22:19.815 12870 12870 E AndroidRuntime: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:504)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
02-01 20:22:19.815 12870 12870 E AndroidRuntime: Caused by: java.lang.reflect.InvocationTargetException
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    ... 1 more
02-01 20:22:19.815 12870 12870 E AndroidRuntime: Caused by: java.nio.file.AccessDeniedException: /storage/emulated/0
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:434)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at java.nio.file.Files.newDirectoryStream(Files.java:457)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at java.nio.file.Files.newDirectoryStream(Files.java:514)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at kotlin.io.path.PathsKt__PathUtilsKt.listDirectoryEntries(PathUtils.kt:398)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at kotlin.io.path.PathsKt__PathUtilsKt.listDirectoryEntries$default(PathUtils.kt:397)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at space.taran.arknavigator.utils.FileUtilsKt.listChildren(FileUtils.kt:41)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at space.taran.arknavigator.mvp.presenter.adapter.FoldersGridPresenter.onItemClick(FoldersGridPresenter.kt:49)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at space.taran.arknavigator.ui.adapter.FoldersRVAdapter.onBindViewHolder$lambda-1(FoldersRVAdapter.kt:31)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at space.taran.arknavigator.ui.adapter.FoldersRVAdapter.$r8$lambda$u13chp9wTOx8Cefskf3DagBMds4(Unknown Source:0)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at space.taran.arknavigator.ui.adapter.FoldersRVAdapter$$ExternalSyntheticLambda0.onClick(Unknown Source:4)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at android.view.View.performClick(View.java:7353)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at android.view.View.performClickInternal(View.java:7319)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at android.view.View.access$3200(View.java:846)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at android.view.View$PerformClick.run(View.java:27846)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at android.os.Handler.handleCallback(Handler.java:873)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:216)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:7211)
02-01 20:22:19.815 12870 12870 E AndroidRuntime:    ... 3 more
02-01 20:22:19.848 12870 12870 I Process : Sending signal. PID: 12870 SIG: 9
melvin4u445 commented 2 years ago

~Actually, this is not reproducible in the latest master. I will confirm and close this if that's indeed the case~

Update: This is reproducible still.

melvin4u445 commented 2 years ago

Reproducible still. Tested with https://github.com/ARK-Builders/ARK-Navigator/actions/runs/2273053656

https://user-images.githubusercontent.com/17034768/167714522-95590b18-a5c7-4c26-8a07-19c936c455cd.mp4

melvin4u445 commented 2 years ago

Closing this ticket. Added details to https://github.com/ARK-Builders/ARK-Navigator/issues/234