Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App crashes evey time when performing operations on chosen storage location with Android 11 (API level 30) #77

Open
betterprogram opened this issue Sep 14, 2022 · 0 comments

Comments

@betterprogram
Copy link

betterprogram commented Sep 14, 2022

It could be an issue with Android 11 (API level 30) and higher because you cannot use the ACTION_OPEN_DOCUMENT_TREE intent action to request access to the Download directory. The app runs well on devices running Android versions earlier than 11. Can it be fixed?

The following error message was copied from Andriod Studio for reference.

D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.yausername.dvd, PID: 26268
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.OPEN_DOCUMENT_TREE flg=0x43 }
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2100)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1747)
at android.app.Activity.startActivityForResult(Activity.java:5465)
at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:675)
at androidx.core.app.ActivityCompat.startActivityForResult(ActivityCompat.java:234)
at androidx.fragment.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:795)
at androidx.fragment.app.FragmentActivity$HostCallbacks.onStartActivityFromFragment(FragmentActivity.java:932)
at androidx.fragment.app.Fragment.startActivityForResult(Fragment.java:1278)
at androidx.fragment.app.Fragment.startActivityForResult(Fragment.java:1266)
at org.yausername.dvd.ui.SettingsFragment.openDirectoryChooser(SettingsFragment.kt:96)
at org.yausername.dvd.ui.SettingsFragment.access$openDirectoryChooser(SettingsFragment.kt:27)
at org.yausername.dvd.ui.SettingsFragment$onCreatePreferences$$inlined$let$lambda$1.onPreferenceClick(SettingsFragment.kt:71)
at androidx.preference.Preference.performClick(Preference.java:1184)
at androidx.preference.Preference.performClick(Preference.java:1166)
at androidx.preference.Preference$1.onClick(Preference.java:181)
at android.view.View.performClick(View.java:7792)
at android.view.View.performClickInternal(View.java:7769)
at android.view.View.access$3800(View.java:910)
at android.view.View$PerformClick.run(View.java:30184)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8641)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1133)
I/Process: Sending signal. PID: 26268 SIG: 9
Disconnected from the target VM, address: 'localhost:55895', transport: 'socket'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant