Search code examples
androidandroid-studioandroid-13

Not able Access the Files in Public Folder after Reinstalling the Android Application


Hi i am trying to look for some solutions for my problem.

After reinstalling my application i am trying to access Files/Folder from the Public Directory(Document Folder) but i am getting open failed: EACCES (Permission denied)

I am working on Android 13 and facing this issue.

Trying with few given solutions on StackOverflow but didn't worked for Android 13.

Like android:requestLegacyExternalStorage="true"

If anyone faced the same issue or have some work around for Android 13. Kindly comment.


Solution

  • I am going to guess that your app wrote content to Documents/, and then you uninstalled/reinstalled the app. If so, then your behavior is expected: you do not have access to content in Documents/ that your app installation did not itself create. In this case, a previous app installation created that content, and Android treats that previous app installation the same as it would if it were any other app.

    There is no "workaround", other than to rethink how you are going about storing and accessing that content. For example, you might consider switching to using the Storage Access Framework.