Flutter app not starting due to dependency issue with firebase:firebase-ml-vision and Google Services

Viewed 816

My Flutter project started giving error when I try to run the app. After getting the error, I updated my dependencies to the latest one as per the migration guide (https://firebase.flutter.dev/docs/migration/) but it is still failing. I did not make any changes to my project since yesterday but today when I tried to run it, it stated giving this error.

Following are my latest dependencies:

    firebase_core: ^0.5.2
    firebase_auth: ^0.18.3
    firebase_crashlytics: ^0.2.3
    cloud_firestore: ^0.14.3
    cloud_functions: ^0.7.0+1
    firebase_storage: ^5.0.1
    firebase_admob: ^0.10.2
    firebase_messaging: ^7.0.3
    mlkit: ^0.15.1

Error on statup:

    Launching lib/main.dart on Android SDK built for x86 in debug mode...
    Running Gradle task 'assembleDebug'...
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
    > In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[19.0.
      2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.
    
      Dependency failing: com.google.android.gms:play-services-vision:20.0.0 -> com.google.android.gms:play-services-vision-co
      mmon@[19.0.2], but play-services-vision-common version was 19.1.0.
    
      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 onto com.google.firebase:firebase-ml-vision@{strictly 24.1.0}
      -- Project 'app' depends onto com.google.firebase:firebase-ml-vision-image-label-model@{strictly 20.0.2}
      -- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 19.1.0}
      -- Project 'app' depends on project 'mlkit' which depends onto com.google.firebase:firebase-ml-vision-image-label-model@
      17.+
      -- Project 'app' depends onto com.google.android.gms:play-services-vision-image-label@{strictly 18.0.4}
      -- Project 'app' depends onto com.google.android.gms:play-services-vision@{strictly 20.0.0}
      -- Project 'app' depends onto com.google.android.gms:play-services-vision-image-labeling-internal@{strictly 16.0.0}
      -- Project 'app' depends on project 'mlkit' which depends onto com.google.firebase:firebase-ml-vision@20.+
    
      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 1s
    Exception: Gradle task assembleDebug failed with exit code 1
0 Answers
Related