【问题标题】:The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility构建失败可能是由于插件中的 AndroidX 不兼容。该工具即将尝试使用Jetifier解决不兼容问题
【发布时间】:2021-11-01 16:54:26
【问题描述】:

将 google_mobile_ads 插件添加到我的 Flutter 项目后,当我尝试运行我的应用程序时出现以下错误。

Launching lib\main.dart on Android SDK built for x86 in debug mode...

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\Simon\.gradle\caches\transforms-2\files-2.1\fb3ac92d6ea8a3919475bb567eb91a20\core-1.7.0-alpha02\res\values\values.xml:105:5-114:25: AAPT: error: resource android:attr/lStar not found.

* 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 1m 18s
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:\flutter\.pub-cache\hosted\pub.dartlang.org\audioplayers-0.19.0\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 3s

Exception: The plugin audioplayers could not be built due to the issue above.
Exited (sigterm)

奇怪的是,当我返回未添加 google_mobile_ads 的旧版本应用时,我仍然收到类似的错误。

我尝试过更改版本 类路径'com.android.tools.build:gradle:3.5.0' 在 build.gradle 从 3.5.0 到 4.0.1,我仍然得到同样的错误。

非常感谢任何帮助。谢谢

【问题讨论】:

  • 升级你的 gradle 版本。
  • 文件 -> 打开 -> Android 文件夹让它构建然后尝试运行。
  • 非常感谢

标签: flutter admob flutter-dependencies flutter-plugin googlemobileads


【解决方案1】:

我做了三件事,其中一些解决了问题。

  1. 安装最新版本的音频播放器插件。
  2. 使用 Android Studio 打开 android 文件夹并构建 -> 重建项目
  3. 在 Android Studio 中,将 Gradle 从 3.x.x 更新到 5.x.x

【讨论】:

    猜你喜欢
    • 2022-01-07
    • 2021-07-13
    • 2021-01-15
    • 2020-08-11
    • 2021-06-24
    • 2020-10-15
    • 2023-01-31
    • 2019-11-07
    • 2014-05-28
    相关资源
    最近更新 更多