android - Flutter Android 资源链接失败,无法应用插件 [id 'kotlin-android']
问题描述
2个月后打开一个项目,出现空安全错误更改了一些插件,并升级了其他插件,一件事导致了另一件事,现在我被这个错误困住了!
尝试 Flutter clean 并删除 build 和 .gradle 文件夹,但没有任何效果。
Launching lib\main.dart on RMX1801 in debug mode...
lib\main.dart:1
3
registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
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
C:\Users\Dell\.gradle\caches\transforms-2\files-2.1\b94a6b46912fba96397655c3d1ce5de0\play-services-ads-lite-19.6.0\AndroidManifest.xml:27:5-38:15: AAPT: error: unexpected element <queries> found in <manifest>.
* 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 8m 59s
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
Building plugin audioplayers...
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Dell\flutter\.pub-cache\hosted\pub.dartlang.org\audioplayers-0.18.2\android\build.gradle' line: 25
* What went wrong:
A problem occurred evaluating root project 'audioplayers'.
> Failed to apply plugin [id 'kotlin-android']
> The current Gradle version 4.10.2 is not compatible with the Kotlin Gradle plugin. Please use Gradle 5.3 or newer, or the previous version of the Kotlin plugin.
* 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 54s
2
Exception: The plugin audioplayers could not be built due to the issue above.
Exited (sigterm)
解决方案
你得到一个AAPT: error: unexpected element <queries> found in <manifest>.
看起来你必须将你的 gradle 版本更新到此处列出的版本之一
https://github.com/miguelpruivo/flutter_file_picker/wiki/Troubleshooting
3.3.3
3.4.3
3.5.4
3.6.4
4.0.1
由于您使用的是 4.10.2,因此您似乎需要降级您的 gradle 版本
推荐阅读
- visual-studio-code - 带有升序数字的重复行
- vb.net - 根据文本框中的特定值移动到下一条记录
- r - 当我离线时,blogdown 不会渲染 LaTeX
- angular - 以角度运行单元测试
- pentaho-spoon - 在我的文件夹中重命名 pentaho 多个 .ktr 文件
- java - 动态更新观察者中的饼图?
- javascript - 是否可以使用 React-Native-HighCharts 加载带有外部数据的工具提示?
- r - R中的下划线图
- c# - 将字符串转换为 HTML 以通过 WebMethod 注入段落
- angular6 - 使用反应式表单时未检索到 FormArray 的表单控件值