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

The WRITE_EXTERNAL_STORAGE permission becomes useless in Android 10 #23

Closed
mickeylam opened this issue Mar 2, 2021 · 8 comments
Closed

Comments

@mickeylam
Copy link

react-native-blob-util: '0.13.2'
react-native: '0.61.2'

As of Nov 2020, all the android app published in the Google Play needs to set the targetSdkVersion to at least 29. The "android:maxSdkVersion" setting in the manifest makes the WRITE_EXTERNAL_STORAGE in the PermissionAndroid becomes useless in Android 10.
I have been taking a while to find that in my app mergedManifest. Finally, I added this:
tools:remove="android:maxSdkVersion"
to the permission WRITE_EXTERNAL_STORAGE.

I think it needs to be fixed. Meanwhile, and support Android 11 in future.

@RonRadtke
Copy link
Owner

The current version is working well on Android 11. Tested it on my own Android 11 device. But I'm storing the files in the apps own directory and due to that it's not a problem for me.

In Android 10 and above you don't need the WRITE_EXTERNAL_STORAGE anymore due to the scoped storage. But you're write. The permissons are not exactly ocrrect. The android:maxSDKVersion has to be a 29, so it still works for Android 10.
Starting from Android 11 we would need the MANAGE_EXTERNAL_STORAGE permisson.
For additional information see here: https://developer.android.com/training/data-storage#permissions

@cristianoccazinsp
Copy link

I was targetting SDK 30 and no issues so far with WRITE_EXTERNAL_STORAGE. However, after upgrading rn-fetch-blob 0.12.0 to this (0.13.6), trying to request WRITE_EXTERNAL_STORAGE always returns "never ask again".

How does this library interfere with file permissions?

@arunim2405
Copy link

@cristianoccazinsp facing the same weird issue, were you able to fix it?

@cristianoccazinsp
Copy link

Not really, I still see the crash from time to time, but doesn't seem to happen as often as to worry.

@glaeser-adesso
Copy link

glaeser-adesso commented Jun 9, 2021

I'm also facing the same issue, forbidding me from using this library instead of the original rn-fetch-blob.
As soon as I add the plugin (Version 0.13.2), WRITE_EXTERNAL_STORAGE is permanently denied (no other modifications to the project). This causes issues for other plugins relying on it.

Using Target SDK Level 29, testing on Device with Android 11. Is there any workaround, other than staying on the unmaintained plugin?

@RonRadtke
Copy link
Owner

I published 0.13.8 right now.
This removes the max version in the manifest. I hope that this was causing the problems.
Could you please test if that helps for your cases? I can't reproduce it on my devices / with my app.

@RonRadtke RonRadtke reopened this Jun 18, 2021
@arunim2405
Copy link

@RonRadtke I can confirm WRITE_EXTERNAL_STORAGE is NOT permanently denied anymore after the update. That bug is fixed

@RonRadtke
Copy link
Owner

@arunim2405 Glad to hear that! Thank you.

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