aapt: error: attribute android:requestlegacyexternalstorage not found.
时间: 2023-05-04 14:00:24 浏览: 1157
这个错误是因为在你的Android项目中,你可能使用了一个名为「android:requestlegacyexternalstorage」的属性,而这个属性实际上是在Android 11中才被引入的。如果你的App还兼容旧版本的Android(例如Android 10及以下),那么这个错误就会发生。解决这个问题的方法是把这个属性从你的代码中移除,或者升级你的Android项目以适应新的Android 11。
相关问题
AAPT: error: attribute android:android.support.v7.widget not found.
The error message indicates that there is no attribute called "android.support.v7.widget" in your Android project. This attribute was commonly used in older versions of Android and has been replaced with "androidx.appcompat.widget" in newer versions.
To fix the error, you need to replace all occurrences of "android.support.v7.widget" with "androidx.appcompat.widget" in your project's XML files. You can do this manually or by using the "Refactor" option in Android Studio.
Also, make sure that you have added the necessary dependencies for the AppCompat library in your project's build.gradle file. You can add the following lines to the dependencies section of your build.gradle file to use the latest version of AppCompat:
```
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
```
After making these changes, clean and rebuild your project to ensure that the changes are applied correctly.
D:\MyApplicationhzuanlian\app\src\main\res\anim\left_in.xml:6: AAPT: error: attribute android:druation not found.
D:\MyApplicationhzuanlian\app\src\main\res\anim\left_in.xml:6: AAPT: error: attribute android:druation not found 是一个AAPT编译错误,它指示在left_in.xml文件的第6行中找不到android:druation属性。这个错误通常是由于拼写错误或者属性名称错误导致的。
要解决这个问题,你需要检查left_in.xml文件的第6行,并确保属性名称拼写正确。在这种情况下,你可能想要检查是否将属性名称拼写为android:duration而不是android:druation。
如果你确认属性名称拼写正确,但仍然遇到此错误,请确保你的项目中包含了正确的Android SDK版本,并且在项目的build.gradle文件中设置了正确的compileSdkVersion和targetSdkVersion。