颤振冲突:地理定位器:^5.1.4+1 和google_maps_flutter:^0.5.21+7 生成依赖冲突



目前我正在做一个女巫使用的 Flutter 应用程序:

geolocator: ^5.1.4+1
google_maps_flutter: ^0.5.21+7

当我在"pubspec.yaml"中声明两个依赖项时,它会出现冲突

"FAILURE: Build failed with an exception.

  • 出了什么问题:

    Execution failed for task ':app:preDebugBuild'.

    Android 依赖项 'com.google.android.gms:play-services-tasks' 对于编译 (16.0.1( 和运行时 (17.0.0( 类路径有不同的版本。您应该通过依赖解析手动设置相同的版本">

  • 我也尝试过通过以下方式编辑gradle.properties:

android.useAndroidX=true
android.enableJetifier=true

并在"app/build.gradle"根据需要将依赖项添加为类路径和/或 api:

com.google.android.gms:play-services-tasks

有人面临同样的问题吗?如果你解决了它,你做了什么来解决它?

我遇到了完全相同的问题,尽管使用google_maps_flutter0.5.21+8. 我为每个错误消息添加了以下行以android/app/build.gradle依赖项。然后如下所示:

dependencies {
...
implementation 'androidx.cursoradapter:cursoradapter:1.0.0'
implementation 'androidx.drawerlayout:drawerlayout:1.0.0'
implementation 'androidx.documentfile:documentfile:1.0.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'androidx.arch.core:core-runtime:2.0.0'
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'
implementation 'androidx.fragment:fragment:1.0.0'
implementation 'androidx.core:core:1.1.0'
implementation 'com.google.android.gms:play-services-basement:17.0.0'
implementation 'com.google.android.gms:play-services-base:17.0.0'
}

希望有帮助。如果有更好的方法,请告诉。到目前为止还没有颤振专家。

最新更新