首页 > 解决方案 > 运行我的 Flutter 项目时,我的 Flutter 项目中出现 AndroidX 不兼容问题

问题描述

即使我已经将我的颤振项目迁移到 AndroidX,我的颤振项目中也出现了 AndroidX 不兼容问题。并且仍然再次遇到同样的问题。我已经按照 Flutter 文档迁移到 AndroidX 在这里我分享了文档的链接 https://flutter.dev/docs/development/androidx-migration

请帮帮我。我花了这么多小时仍然没有得到任何解决方案。提前致谢。

我得到的错误如下

Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'androidx.coordinatorlayout:coordinatorlayout' has different version for the compile (1.0.0-rc01) and runtime (1.0.0) classpath. You should manually set the same version via DependencyResolution

* 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://gradle.org/help/

BUILD FAILED in 44s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://flutter.dev/docs/development/androidx-migration for more information on the problem and how to fix it.
*******************************************************************************************
Finished with error: Gradle task assembleDebug failed with exit code 1


标签: androidflutterdartandroidx

解决方案


What is your gradle version in App/build.gradle? this erro possibly has been caused beacause your gradle version is 3.2.1, some packages need gladle 3.3.x or above to work properly


推荐阅读