All of a sudden, I am started getting this build error in my Android project:
Error: unexpected element <queries> found in <manifest>
Understanding the Issue:
To understanding why this happens see the above @CommonsWare's answer
This is because <queries> tag was introduced with new package visibility options for Android 11 and upwards (SDK 30+). Because of that, you need to update your build.gradle with a version that includes this changes. Below is a list of supported gradle options.
The best solution to deal with these errors is to Upgrade your Android Gradle plugin and Update Gradle
You’ll have to update your Gradle version to one of the compatible versions that have the latest query tags (which were introduced with Android 11).
How to Fix it?
To Update the Android Gradle plugin
Specify the plugin version in the YourAppDirectory/android/build.gradle file. The plugin version applies to all modules built-in that Android Studio project. The following example sets the plugin to version 4.0.1:
Gradle downloads it the next time you build your project
To Update Gradle
Specify the Gradle version by editing the Gradle distribution reference in the YourAppDirectory/android/gradle/wrapper/gradle-wrapper.properties file.
Don't forget to update your ditributionUrl in your gradle-wrapper.properties as well. For example, for gradle 4.0.1, you should have:
Comments
Post a Comment