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 crash (java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated) #1

Open
alexbayker opened this issue Apr 11, 2023 · 1 comment

Comments

@alexbayker
Copy link

How can I fix app crash, when I select any path, which upper than start path (/storage/emulated - selected path in example, /storage/emulated/0 - start path)? Or disable using any directories, upper than start path? This is my code to call picker file dialog:

`val i = Intent(context, FilePickerActivity::class.java)
i.putExtra(FilePickerActivity.EXTRA_ALLOW_MULTIPLE, false)
i.putExtra(FilePickerActivity.EXTRA_ALLOW_CREATE_DIR, true)
i.putExtra(FilePickerActivity.EXTRA_MODE, modeDir)
i.putExtra(FilePickerActivity.EXTRA_START_PATH, Environment.getExternalStorageDirectory().path)

    checkStoragePermissions(fileRequest) { startActivityForResult(i, fileRequest) }`
@alexbayker
Copy link
Author

Bug is fixed: wrong provider_paths.xml.

My file:
<paths> <external-path name="ExternalFilesContentProvider" path="." /> </paths>

Correct file:
<paths> <root-path name="FileProvider" path="." /> </paths>

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