flutter - Flutter Stable 1.22.6 无法构建 apk
问题描述
我正在尝试使用颤振稳定版本 1.22.6 构建 apk,但在下面不断出现错误;
错误
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\emirk\.gradle\caches\transforms-2\files-2.1\3dd4f179ab5210ef1c86848f5b37a403\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
BU�LD FAILED in 15s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 16,4s
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...
The plugin cloud_firestore could not be built due to the issue above.
所以我跑了 Flutter Doctor,这是 Flutter Doctor 的结果,
[√] Flutter (Channel stable, 1.22.6, on Microsoft Windows [Version 10.0.19042.746], locale tr-TR)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[!] Android Studio (version 4.1.0)
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code, 64-bit edition (version 1.52.1)
[√] Connected device (1 available)
知道为什么会这样吗?
解决方案
将您的代码迁移到 AndroidX 希望它能解决问题https://flutter.dev/docs/development/androidx-migration
推荐阅读
- tomcat - Tomcat9 / Java11 升级:截断 POST 正文?
- ios - 呈现视图控制器并允许用户向后滑动
- r - 闪亮的渲染图返回空白
- java - Kotlin 中类型参数化类的 Java 静态方法的引用
- python - 我们如何使用 python 驱动程序连接到远程 Cassandra 服务器
- reactjs - 使用 Gatsby 和 Stripe 时如何修复“IntegrationError: No such sku: "prod_....." 错误
- ios - 如何调整 CALayer 大小以适应父视图
- excel - 工作表的 Excel Vba 复制方法失败 - 从 xlApp 复制到 ThisWorkbook
- php - 为什么我通过 Cloudflare 收到连续的 524 错误?
- azure - 有没有办法检查 Log Analytics 字段中的子字符串是否存在?