【问题标题】:AndroidX incompatibilities issue arises in my Flutter project while run my flutter project运行我的 Flutter 项目时,我的 Flutter 项目中出现 AndroidX 不兼容问题
【发布时间】:2019-10-29 08:55:30
【问题描述】:

即使我已将我的 Flutter 项目迁移到 AndroidX,我的 Flutter 项目也遇到了 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


【问题讨论】:

  • 对我来说,我所做的只是将android.useAndroidX=trueandroid.enableJetifier=true 添加到android/gradle.properties
  • 这对我来说已经是真的了 android.useAndroidX=trueandroid.enableJetifier=true 在我的颤抖中 android/gradle.properties。仍然出现同样的错误
  • 有些包需要更新的 gradle 版本。您可以使用他们的早期版本或只升级您的 gradle 版本。

标签: android flutter dart androidx


【解决方案1】:

您在 App/build.gradle 中的 gradle 版本是什么?这个错误可能是因为你的gradle版本是3.2.1,一些包需要gladle 3.3.x或更高版本才能正常工作

【讨论】:

    猜你喜欢
    • 2020-05-03
    • 2019-11-19
    • 2020-01-25
    • 1970-01-01
    • 2021-02-15
    • 2021-01-30
    • 1970-01-01
    • 2020-08-12
    • 2022-06-10
    相关资源
    最近更新 更多