mohammed nabil
mohammed nabil

Reputation: 107

Could not determine the dependencies of task ':app:preDebugBuild'

I am build an app with firebase dependencies before creating an app i have done the firebase configuration and added firebase dependencies in pubspec.yaml. But when i run the app i got some errors.

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:[email protected]
  -- Project 'app' depends on project 'firebase_core' which depends onto com.google.firebase:[email protected]
  -- 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

Upvotes: 1

Views: 420

Answers (1)

Ananthu Ashokan
Ananthu Ashokan

Reputation: 21

The Problem occur when the dependencies cannot download from jcenter server. change your network connection follows flutter clean and try again

you can still work in debug mode

flutter run --debug will work

or you can goto File > Settings>Build,Execution,Deployment>Build Tools>Gradle>Uncheck Offline work option in Android Studio

You can also invalidate Cache and Restart

Upvotes: 2

Related Questions