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

Failed to use legacy storage on Android 12 after upgrading to version 10.5.1 #386

Closed
raymondctc opened this issue Jun 11, 2021 · 4 comments

Comments

@raymondctc
Copy link

Steps to Reproduce the Problem

  • Upgraded from 10.4.2 to 10.5.1

Expected Behavior

  • WRITER_EXTERNAL_STORAGE should not have the attribute android:maxSdkVersion=28 appended.

Actual Behavior

  • WRITER_EXTERNAL_STORAGE has the attribute android:maxSdkVersion=28 appended, which causes our app not functioning and it's not expected.

Left is the AndroidManifest.xml after upgrading to 10.5.1, right is the AndroidManifest.xml from 10.4.2. (Decompiled from our APK)
image

Instabug integration code

  • N/A

SDK Version

  • 10.5.1

Android Version

  • Android 12

Device Model

  • N/A

[Optional] Project That Reproduces the Issue

@MShannan
Copy link

Hello @raymondctc
Thanks for reporting this, according to recent Google / Android privacy changes, they restricts the use of All files access to apps that target Android 11 (API level 30) and above.
We recommend using the privacy friendly alternatives (e.g., MediaStore API, or Storage Access Framework) and if you think these apis are not sufficient for your app to provide its core functionality, you can use this snippet

<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    tools:remove="android:maxSdkVersion"/>

to override WRITE_EXTERNAL_STORAGE permission in your AndroidManifest.xml and Google Play may provide a temporary exception for your app according to this.

Let us know if that worked for you or you have any concerns,
Thanks.

@amrbrkt
Copy link
Contributor

amrbrkt commented Jul 29, 2021

We are closing this issue for now, please don't hesitate to get back to us if you still have any problem.

@amrbrkt amrbrkt closed this as completed Jul 29, 2021
@SudoPlz
Copy link

SudoPlz commented Aug 6, 2021

@MShannan
Hey there,
we literally just spent hours and hours trying to figure out why our permissions checker returned DENIED on WRITE_EXTERNAL_STORAGE after the user had enabled that permission.. The weirdest thing ever.

Luckily we happened to notice in the merged built manifest files that weird android:maxSdkVersion value.....
Now why on earth would you declare that, and not inform anyone about it?

This broke our file picker in production, and made us waste lot's of hours trying to figure out what was wrong.

Also, you mention Android privacy changes. Are there any plans to implement those Android privacy changes to your library instead of working around it (and breaking our projects by using maxSdkVersion)?.

I admit I feel a bit frustrated right now, because we're using your library to fix bugs, not create more.

Thank you

@vegerot12
Copy link

Hello @raymondctc Thanks for reporting this, according to recent Google / Android privacy changes, they restricts the use of All files access to apps that target Android 11 (API level 30) and above. We recommend using the privacy friendly alternatives (e.g., MediaStore API, or Storage Access Framework) and if you think these apis are not sufficient for your app to provide its core functionality, you can use this snippet

<uses-permission
    android:name="android.permission.WRITE_EXTERNAL_STORAGE"
    tools:remove="android:maxSdkVersion"/>

to override WRITE_EXTERNAL_STORAGE permission in your AndroidManifest.xml and Google Play may provide a temporary exception for your app according to this.

Let us know if that worked for you or you have any concerns, Thanks.

Upon adding that line. Remove Android max version. I'm not able to generate release build. Getting this error. "The prefix tools for attribute tools:remove associated with an element type uses-permission is not bound". Can someone help. Anyone faced this issue. ?

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

5 participants