Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File picker : unexpected element <queries> found in <manifest>

Whenever I add file picker package to pubspec.yaml file and re run the app I get the following error:

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':app:processDebugResources'.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Android resource linking failed D:\MY_PROJECTS\flutter_projects\health_app\build\file_picker\intermediates\library_manifest\debug\AndroidManifest.xml:9:5-15:15: AAPT: error: unexpected element found in .

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 19s The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility. Building plugin cloud_firestore... Running Gradle task 'assembleAarRelease'... Exception: The plugin cloud_firestore could not be built due to the issue above.

like image 537
Niteesh Avatar asked Dec 07 '22 09:12

Niteesh


1 Answers

found the solution here

Build is failing with unexpected element found in .

🛠 Possible solution: This is because 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.

3.3.3

3.4.3

3.5.4

3.6.4

4.0.1 Don't forget to update your ditributionUrl in your gradle-wrapper.properties as well. For example, for gradle 4.0.1, you should have:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

like image 195
Niteesh Avatar answered Dec 22 '22 00:12

Niteesh