Android 10/11: WRITE_EXTERNAL_STORAGE warning with maxSdkVersion flag

983 Views Asked by At

With scope storage introduced in Android 10, WRITE_EXTERNAL_STORAGE permission is no longer in use and we get a warning. However as far as I can tell, this permission is still needed in versions below Q, so I added android:maxSdkVersion="28" to the permission. But that doesn't silence the warning. Is this a bug or is there something else I must do?

1

There are 1 best solutions below

0
On

Yes it is a limitation but you can ignore the warning using design tools like below tools:ignore="ScopedStorage"

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage" />

You have to add tools namespace in the manifest element like below

<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"