2

I am not able to open file picker in android 10 and showing toast Failed to create image file...but working fine in android 9.

4
  • can you show your code ? Commented Jan 17, 2020 at 12:56
  • we're going to need some code to be able to help you. Commented Jan 17, 2020 at 12:56
  • @androidkumar , I am also facing same issue .Can u please answer if it is solved . Commented Feb 26, 2021 at 13:23
  • You must use app directory to store the File. Remove the Relative access Path. Commented Mar 11, 2021 at 15:52

1 Answer 1

1

Because Google have made file paths outside of the App's private directories useless with their scoped storage changes in Android 10, as the picture is of a non standard file picker, I guess it has not been updated (or deprecated as you can do a lot with the builtin stuff)

See https://developer.android.com/training/data-storage

Depending on the types of files you need to use MediaStore or Storage Access Framework (SAF), details https://developer.android.com/training/data-storage/shared for files outside of your App's private directories.

As it looks like picking photos, you might be able to use Google photo app to pick.

Though as a quick fix is to temporarily opt out https://developer.android.com/training/data-storage/compatibility but this will only work until Android 11

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.