AAPT: error: attribute android:requestLegacyExternalStorage not found AAPT: error: attribute android:requestLegacyExternalStorage not found android android

AAPT: error: attribute android:requestLegacyExternalStorage not found


(Material Files author here)

You need to compile against SDK 29 and maybe use the most recent build tools for aapt to know this attribute, because it's introduced in Android 10.


Make these changes in android\app\build.gradle :

compileSdkVersion 29targetSdkVersion 29

It will work.


Add this to build.gradle

subprojects {    afterEvaluate {project ->        if (project.hasProperty("android")) {            android {                compileSdkVersion 29                buildToolsVersion "29.0.2"            }        }    }}