hedzr / android-file-chooser

a lightweight file/folder chooser or picker
Apache License 2.0
284 stars 62 forks source link

Runtime Exception #73

Open ytheekshana opened 5 years ago

ytheekshana commented 5 years ago

Got this today. image

Fatal Exception: java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=782, result=0, data=null} to activity {com.ytheekshana.deviceinfo/com.obsez.android.lib.filechooser.permissions.PermissionActivity}: java.lang.RuntimeException: there are no permissions at android.app.ActivityThread.deliverResults(ActivityThread.java:5002) at android.app.ActivityThread.handleSendResult(ActivityThread.java:5044) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2155) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:7539) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)

Caused by java.lang.RuntimeException: there are no permissions at com.obsez.android.lib.filechooser.permissions.PermissionActivity.onRequestPermissionsResult(PermissionActivity.java:73) at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:7934) at android.app.Activity.dispatchActivityResult(Activity.java:7784) at android.app.ActivityThread.deliverResults(ActivityThread.java:4995) at android.app.ActivityThread.handleSendResult(ActivityThread.java:5044) at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:49) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2155) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:7539) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)

hedzr commented 5 years ago

version 9? it should be lower than minSDK.

hedzr commented 5 years ago

or android 9 P?, cc @Guiorgy

ytheekshana commented 5 years ago

Its android 9 Pie

joielechong commented 5 years ago

Android permission is really a delicate problem... There is no single solution for the problem because some manufactures change the permission with their own implementation (especially Chinese device Manufactures like Xiaomi, Huawei, Vivo, Oppo, etc). There is no easy way out.. :/

I think the android-file-chooser should not handle the permission and let the user to use their own Permission handling, either using their own code or using permission library. How do you thing @hedzr ?

ytheekshana commented 5 years ago

Android permission is really a delicate problem... There is no single solution for the problem because some manufactures change the permission with their own implementation (especially Chinese device Manufactures like Xiaomi, Huawei, Vivo, Oppo, etc). There is no easy way out.. :/

I think the android-file-chooser should not handle the permission and let the user to use their own Permission handling, either using their own code or using permission library. How do you thing @hedzr ?

I'd like that

hedzr commented 5 years ago

You could handle its whatever you need at first. If u do sth like that, afc's checkPermissions can ignore internal logic. but if u have no any idea to do or just forget permissions' check, the internal check and launcher can defend its. I feel same with you about those devices. maybe, you have to grant some perms before ChooserDialoog.show(). IMHO, all permissions should be grouped by its types and priorities, and some of them should be requested to end-user at first running. If so, afc's inner codes about permissions will not puzzle u.