简体   繁体   中英

Android 10/11: WRITE_EXTERNAL_STORAGE warning with maxSdkVersion flag

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?

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM