【问题标题】:Flutter Stable 1.22.6 can't build apk [duplicate]Flutter Stable 1.22.6 无法构建 apk [重复]
【发布时间】:2021-05-08 10:20:09
【问题描述】:

我正在尝试使用 Flutter 稳定版 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)

知道为什么会这样吗?

【问题讨论】:

标签: flutter apk version


【解决方案1】:

将您的代码迁移到 AndroidX 希望它能解决问题https://flutter.dev/docs/development/androidx-migration

【讨论】:

  • 已经在使用androidX了
  • 构建失败可能是由于插件中的 AndroidX 不兼容。该工具即将尝试使用Jetfier解决不兼容问题。这描述了它不使用它将整个项目复制到新项目
猜你喜欢
  • 2021-05-22
  • 2020-01-27
  • 2020-05-15
  • 1970-01-01
  • 1970-01-01
  • 2021-05-03
  • 2023-01-19
  • 2021-04-22
相关资源
最近更新 更多