Firebase 无法确定任务“:app:preDebugBuild”的依赖项

Firebase 无法确定任务“:app:preDebugBuild”的依赖项,firebase,flutter,Firebase,Flutter,在创建应用程序之前,我正在构建一个具有firebase依赖项的应用程序。我已经完成了firebase配置,并在pubspec.yaml中添加了firebase依赖项。但是当我运行应用程序时,我遇到了一些错误 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:preDebugBuild'. > In project 'a

在创建应用程序之前,我正在构建一个具有firebase依赖项的应用程序。我已经完成了firebase配置,并在pubspec.yaml中添加了firebase依赖项。但是当我运行应用程序时,我遇到了一些错误

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:preDebugBuild'.
> In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[15.0.
  1]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

  Dependency failing: com.google.android.gms:play-services-flags:15.0.1 -> com.google.android.gms:play-services-basement@[
  15.0.1], but play-services-basement version was 16.0.1.

  The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
  ifact with the issue.
  -- Project 'app' depends on project 'firebase_auth' which depends onto com.google.firebase:firebase-auth@16.0.2
  -- Project 'app' depends on project 'firebase_core' which depends onto com.google.firebase:firebase-core@16.0.4
  -- Project 'app' depends on project 'firebase_database' which depends onto com.google.firebase:firebase-database@15.+

  For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
  endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
  github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
  uild.gradle file.

* 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 2s
Finished with error: Gradle task assembleDebug failed with exit code 1

当依赖项无法从jcenter server下载时,就会出现问题。请更改网络连接,然后清除并重试

您仍然可以在调试模式下工作

颤振运行-调试将工作

或者您可以转到文件>设置>构建、执行、部署>构建工具>渐变>取消选中Android Studio中的脱机工作选项


您还可以使缓存失效并重新启动

我也遇到了这个问题,您解决了吗?