【发布时间】: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=true和android.enableJetifier=true添加到android/gradle.properties -
这对我来说已经是真的了
android.useAndroidX=true和android.enableJetifier=true在我的颤抖中android/gradle.properties。仍然出现同样的错误 -
有些包需要更新的 gradle 版本。您可以使用他们的早期版本或只升级您的 gradle 版本。
标签: android flutter dart androidx