Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [firebase_ml_vision] Can't find ml-vision-image-label-model that works with the latest plugin update #3995

Closed
leonardocustodio opened this issue Oct 29, 2020 · 26 comments
Labels
platform: android Issues / PRs which are specifically for Android. plugin: ml_vision type: bug Something isn't working

Comments

@leonardocustodio
Copy link

leonardocustodio commented Oct 29, 2020

Hello,

After the last update of firebase plugins. I can't find any version of ml-vision-image-label-model that will work.

Here is the log output:

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

Before this last update I was using the 20.0.1 model:
api 'com.google.firebase:firebase-ml-vision-image-label-model:20.0.1'

With this plugin versions:

firebase_core: ^0.5.0+1
firebase_messaging: ^7.0.3
firebase_analytics: 6.0.2
firebase_crashlytics: 0.2.1+1
firebase_remote_config: 0.4.0+2
firebase_admob: 0.10.0+2
firebase_auth: 0.18.1+2
cloud_functions: ^0.6.0+1
firebase_ml_vision: 0.9.7

And it was working fine. After updating to:

firebase_core: ^0.5.1
firebase_messaging: ^7.0.3
firebase_analytics: ^6.1.0
firebase_crashlytics: ^0.2.2
firebase_remote_config: ^0.4.1
firebase_admob: ^0.10.1
firebase_auth: ^0.18.2
cloud_functions: ^0.6.0+1
firebase_ml_vision: ^0.9.8

I can't find any version that will work anymore..... I tried the latest 20.0.2 and also all 19+ versions....

Regards,
Leonardo

@leonardocustodio leonardocustodio added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Oct 29, 2020
@leonardocustodio leonardocustodio changed the title 🐛 [firebase_ml_vision] Your issue title here 🐛 [firebase_ml_vision] Can't find ml-vision-image-label-model what works with the latest plugin update. Oct 29, 2020
@leonardocustodio leonardocustodio changed the title 🐛 [firebase_ml_vision] Can't find ml-vision-image-label-model what works with the latest plugin update. 🐛 [firebase_ml_vision] Can't find ml-vision-image-label-model that works with the latest plugin update Oct 29, 2020
@leonardocustodio
Copy link
Author

leonardocustodio commented Oct 29, 2020

So I decided to update the plugins one by one, to see which one was incompatible.....

When using:
api 'com.google.firebase:firebase-ml-vision-image-label-model:20.0.1'

If we upgrade from
firebase_ml_vision: 0.9.7

to
firebase_ml_vision: 0.9.8

It still works........ The problem happens when upgrading the firebase_core to:
firebase_core: 0.5.1

When upgrading the core from 0.5.0+1 to 0.5.1 it starts to give the error. We would expect to have to upgrade the image-label-model to the latest version as well from 20.0.1 to 20.0.2 but that doesn't fixes the issue. Actually no versions from 19-20 fixes this issue. So I had to downgrade the core to 0.5.0+1, keep using image-label-model 20.0.1 and it would work with the latest ml_vision plugin version.

@kw2019ltd
Copy link

same getting this issue

event sent after app closed: {id: 0, progressId: null, message: Running "flutter pub get" in barcode_pro_app...}
event sent after app closed: {id: 0, progressId: null, finished: true}
Launching lib\main.dart on HD1903 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 on project 'firebase_ml_vision' which depends onto com.google.firebase:[email protected].
0
-- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 19.1.0}
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.firebase:firebase-ml-vision-barcode-model@{strictly 16.1.2}
-- 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}

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 12s
Exception: Gradle task assembleDebug failed with exit code 1

using below:
#fireBase
firebase_core: ^0.5.0+1
firebase_crashlytics: ^0.2.2
firebase_analytics: ^6.1.0
firebase_messaging: ^7.0.3
firebase_ml_vision: ^0.9.8
firebase_remote_config: ^0.4.1

@kw2019ltd
Copy link

@TahaTesser

@darshankawar
Copy link

@leonardocustodio
I tried the official firebase_ml_vision plugin example using latest Master version and updated the firebase_core and ml_vision plugin to latest per your comments, but was able to compile and run the app without any issues.

flutter doctor -v
[✓] Flutter (Channel master, 1.24.0-4.0.pre.165, on Mac OS X 10.15.4 19E2269 darwin-x64,
    locale en-IN)
    • Flutter version 1.24.0-4.0.pre.165 at /Users/dhs/documents/Fluttersdk/flutter
    • Framework revision e444b1e3fa (7 hours ago), 2020-10-30 00:41:52 -0400
    • Engine revision 99cc50dfff
    • Dart version 2.11.0 (build 2.11.0-266.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/dhs/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.50.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.15.1

[✓] Connected device (5 available)
    • Darshan's iphone (mobile)           • 21150b119064aecc249dfcfe05e259197461ce23 •
      ios            • iOS 14.0
    • iPhone SE (2nd generation) (mobile) • 6C85835D-FBFD-4AB3-8DE8-B4FAD35E5367     •
      ios            • com.apple.CoreSimulator.SimRuntime.iOS-14-0 (simulator)
    • macOS (desktop)                     • macos                                    •
      darwin-x64     • Mac OS X 10.15.4 19E2269 darwin-x64
    • Web Server (web)                    • web-server                               •
      web-javascript • Flutter Tools
    • Chrome (web)                        • chrome                                   •
      web-javascript • Google Chrome 86.0.4240.111

• No issues found!


Are there any specific steps to replicate the issue ?

@darshankawar darshankawar added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Oct 30, 2020
@leonardocustodio
Copy link
Author

leonardocustodio commented Oct 30, 2020

Hello @darshankawar,

I didn't need to do anything to happen the issue. I only updated the plugin. But did you also add:
api 'com.google.firebase:firebase-ml-vision-image-label-model:20.0.1'

On the app level build.gradle dependencies? Also I did not say on my comment but the problem in compiling is happening on Android, haven't tested with iOS yet.

Also, here is my flutter doctor that I haven't posted before:

[√] Flutter (Channel stable, 1.22.2, on Microsoft Windows [Version 10.0.19041.508], locale pt-BR)
    • Flutter version 1.22.2 at C:\flutter
    • Framework revision 84f3d28555 (2 weeks ago), 2020-10-15 16:26:19 -0700
    • Engine revision b8752bbfff
    • Dart version 2.10.2

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at C:\NVPACK\android-sdk-windows
    • Platform android-30, build-tools 30.0.1
    • ANDROID_HOME = C:\NVPACK\android-sdk-windows
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    • All Android licenses accepted.

[!] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[√] VS Code (version 1.50.1)
    • VS Code at C:\Users\Leonardo\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.15.1

[√] Connected device (1 available)
    • Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

! Doctor found issues in 1 category.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Oct 30, 2020
@leonardocustodio
Copy link
Author

Hmmm on the example it is using version 17.0.2
I've downgraded to it and also it doesn't work, the same compiling error on android when using firebase_core 0.5.1 and ml_vision 0.9.8

ps.: I'm using the 20.0.1 instead of 17.0.2 because it was the version supported on the previous version by match making on: https://firebase.google.com/support/release-notes/android

Still even with the 17.0.2 on the example it does not work.

@sceee
Copy link

sceee commented Oct 30, 2020

This suddenly also popped up on my end after updating firebase_core: 0.5.0+1 to 0.5.1.
Downgrading fixes it for me.

@kw2019ltd
Copy link

@darshankawar pls check it its backward compatible break

@kw2019ltd
Copy link

@darshankawar i just donwlaoded FirebaseExtended project and build the example of firebase_ml_vision\example

same issue you can try it.

Microsoft Windows [Version 10.0.18363.1139]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\kotai\AndroidStudioProjects\flutterfire\packages\firebase_ml_vision\example>flutter build apk
Warning: You are using these overridden dependencies:
! firebase_core 0.5.1 from path ....\firebase_core\firebase_core
Running "flutter pub get" in example... 6.1s
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It's being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
To generate an app bundle, run:
flutter build appbundle --target-platform android-arm,android-arm64,android-x64
Learn more on: https://developer.android.com/guide/app-bundle
To split the APKs per ABI, run:
flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
Learn more on: https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':app:lintVitalRelease'.

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.android.gms:play-services-vision-face-contour-internal@{strictly 16.0.0}
-- Project 'app' depends on project 'firebase_ml_vision' which depends onto com.google.firebase:[email protected].
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 onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.firebase:firebase-ml-vision-face-model@{strictly 20.0.2}
-- 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.firebase:[email protected]
-- Project 'app' depends onto com.google.android.gms:play-services-vision-image-labeling-internal@{strictly 16.0.0}

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 44s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 45.0s
Gradle task assembleRelease failed with exit code 1

image

@Jartz
Copy link

Jartz commented Nov 1, 2020

I solved it this way.
implementation 'com.google.android.gms:play-services-vision:20.1.2'
implementation 'com.google.android.gms:play-services-vision-common:19.1.2'
implementation 'com.google.android.gms:play-services-vision-image-label:18.1.0'

Captura de Pantalla 2020-10-31 a la(s) 10 48 55 p  m

@ahyar4y
Copy link

ahyar4y commented Nov 1, 2020

I solved it this way.
implementation 'com.google.android.gms:play-services-vision:20.1.2'
implementation 'com.google.android.gms:play-services-vision-common:19.1.2'
implementation 'com.google.android.gms:play-services-vision-image-label:18.1.0'

Captura de Pantalla 2020-10-31 a la(s) 10 48 55 p  m

Somehow this solved my issue, thank you

@kw2019ltd
Copy link

kw2019ltd commented Nov 1, 2020 via email

@darshankawar
Copy link

darshankawar commented Nov 2, 2020

Was able to replicate this issue using plugin's official example on latest stable. Was able to compile and run the example app on iOS though. (Tried on iphone SE simulator, iOS 14).

console log
Launching lib/main.dart on SM A260G 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.android.gms:play-services-vision-face-contour-internal@{strictly 16.0.0}
  -- Project 'app' depends on project 'firebase_ml_vision' which depends onto com.google.firebase:[email protected].
  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 onto com.google.firebase:firebase-ml-vision-face-model@{strictly 20.0.2}
  -- Project 'app' depends onto com.google.firebase:[email protected]
  -- 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.firebase:[email protected]
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-image-labeling-internal@{strictly 16.0.0}

  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 1m 1s
Exception: Gradle task assembleDebug failed with exit code 1




flutter doctor -v

[✓] Flutter (Channel stable, 1.22.3, on Mac OS X 10.15.4 19E2269, locale en-IN)
    • Flutter version 1.22.3 at /Users/dhs/documents/Fluttersdk/flutter
    • Framework revision 8874f21e79 (4 days ago), 2020-10-29 14:14:35 -0700
    • Engine revision a1440ca392
    • Dart version 2.10.3

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
    • Android SDK at /Users/dhs/Library/Android/sdk
    • Platform android-30, build-tools 30.0.0
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.0.1, Build version 12A7300
    • CocoaPods version 1.9.3

[✓] Android Studio (version 4.0)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 46.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build
      1.8.0_242-release-1644-b3-6222593)

[✓] VS Code (version 1.50.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.15.1

[✓] Connected device (1 available)
    • SM A260G (mobile) • 5200763ebcfa861f • android-arm • Android 8.1.0 (API
      27)

• No issues found!


@darshankawar darshankawar added plugin: ml_vision type: bug Something isn't working platform: android Issues / PRs which are specifically for Android. and removed Needs Attention This issue needs maintainer attention. labels Nov 2, 2020
@csandovalgt
Copy link

is there any fix for this issue? the solution that worked for @Jartz didn't work for me

@comyuno
Copy link

comyuno commented Nov 6, 2020

is there any fix for this issue? the solution that worked for @Jartz didn't work for me

After hours of debugging I came up with this fix:
pubspec.yaml:
firebase_core: ^0.5.1
firebase_ml_vision: ^0.9.8
app/build.gradle:

dependencies {
        api 'com.google.firebase:firebase-ml-vision-face-model:20.0.2'
    }

implementation 'com.google.android.gms:play-services-vision:20.1.1' implementation 'com.google.android.gms:play-services-vision-common:19.1.1' implementation 'com.google.android.gms:play-services-vision-image-label:18.0.5' implementation 'com.google.android.gms:play-services-vision-face-contour-internal:16.0.2'

it's basically what google recommends here: https://firebase.google.com/support/release-notes/android

@guilhermedaldim
Copy link

Is there any solution to this problem? None of the solutions worked for me

@csandovalgt
Copy link

csandovalgt commented Nov 6, 2020

Is there any solution to this problem? None of the solutions worked for me

Hi, finaly today I make my app works. Today (nov 6) the team released a new version 0.9.9 in pub.dev. Also app/build.gradle is:

implementation 'com.google.firebase:firebase-config:20.0.0'
implementation 'com.google.android.gms:play-services-vision:20.1.2'
implementation 'com.google.android.gms:play-services-vision-common:19.1.2'
implementation 'com.google.android.gms:play-services-vision-image-label:18.1.0'

thank you @comyuno , also your comment guided me to the right configuration in my gradle file.

@guilhermedaldim
Copy link

Is there any solution to this problem? None of the solutions worked for me

Hi, finaly today I make my app works. Today (nov 6) the team released a new version 0.9.9 in pub.dev. Also app/build.gradle is:

implementation 'com.google.firebase:firebase-config:20.0.0'
implementation 'com.google.android.gms:play-services-vision:20.1.2'
implementation 'com.google.android.gms:play-services-vision-common:19.1.2'
implementation 'com.google.android.gms:play-services-vision-image-label:18.1.0'

thank you @comyuno , also your comment guided me to the right configuration in my gradle file.

I managed to make it work, but I had to add to the app/build.grade googleServices {disableVersionCheck = true}

P.S: add googleServices {disableVersionCheck = true} after apply plugin: 'com.google.gms.google-services'

@k0shk0sh
Copy link

k0shk0sh commented Nov 7, 2020

This should do the trick and also ensures vision still works as expected.

    implementation 'com.google.android.gms:play-services-vision-common:19.1.2'
    implementation 'com.google.android.gms:play-services-vision:20.1.2'
    implementation 'com.google.android.gms:play-services-vision-image-labeling-internal:16.0.5'
    api 'com.google.firebase:firebase-ml-vision:24.1.0'
    api 'com.google.firebase:firebase-ml-vision-image-label-model:20.0.2'

@kw2019ltd
Copy link

@darshankawar pls update firebase ml example so we can do the same and no need to guess

@kw2019ltd
Copy link

fix if you using barcode:

dependencies {
 api 'com.google.firebase:firebase-ml-vision-barcode-model:16.1.2'
 api 'com.google.firebase:firebase-ml-vision:24.1.0'
 implementation 'com.google.android.gms:play-services-vision-common:19.1.2'
 implementation 'com.google.android.gms:play-services-vision:20.1.2'
 implementation 'com.google.android.gms:play-services-vision-image-label:18.1.0'
}

@kw2019ltd
Copy link

now we have new big issue, follow on link
#4090

@leonardocustodio
Copy link
Author

leonardocustodio commented Nov 11, 2020

Not even the downgraded version is working anymore. I've downgrade everything back to the versions of the beginning and removed all extra dependencies that I've added in effort to work with ml_vision.

And I'm also getting the "java.lang.IllegalArgumentException: Service not registered: lx@226fed8" error. And I'm pretty sure I'm not using a cached version since I did a flutter clean and deleted every packages before getting them back.

I think this error is not related to the ml_vision itself but to some kind of dependency that is being pulled regardless of the pubspec version. Probably a changed that was made in the last few days since this error was not happening a few days ago with the versions on the beginning of the report. And probably related to this: firebase/firebase-android-sdk#1662

Edit: Stopped happening when I used another emulator with the downgraded version

@bharat-biradar
Copy link

I am facing the same problem.I want to use image labelling and face detection.
If anyone has found the solution please mention it

@cfchris
Copy link

cfchris commented Dec 18, 2020

Hopefully more details will help this be fixed...

(Thank you @comyuno for what I think has finally fixed my issue.)

I have tried to use flutter pub upgrade a few times now over the course of weeks. Every time I did that, it would cause build errors mentioning "firebase". So, I'm going through it step by step as I type this to provide some details.

Before I attempt to update again, flutter pub outdated says the following:

$ flutter pub outdated
Dependencies                      Current                Upgradable             Resolvable             Latest
firebase_messaging                *7.0.2                 7.0.3                  7.0.3                  7.0.3
firebase_ml_vision                *0.9.7                 0.9.10                 0.9.10                 0.9.10

Because Firebase plugins are the only ones (so far) that have caused issues with flutter pub upgrade, I am going to start by using fixed version expressions in my pubspec.yaml.

  firebase_messaging: 7.0.2
  firebase_ml_vision: 0.9.7

flutter pub get and flutter run. Still working.

Now with my fixed versions for the two plugins that I have in pubspec.yaml, I ran flutter pub upgrade. This updated a bunch of transitive dependencies (but not firebase_messaging and firebase_ml_vision).

flutter run. And, we're broken.

* 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.android.gms:play-services-vision-face-contour-internal@{strictly 16.0.0}
  -- Project 'app' depends on project 'firebase_ml_vision' which depends onto com.google.firebase:[email protected].
  0                                                                     
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 19.1.0}
  -- Project 'app' depends onto com.google.firebase:firebase-ml-vision-face-model@{strictly 20.0.2}
  -- 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.firebase:[email protected]

Looking back, I now see that flutter pub outdated said that I had transitive "firebase" dependencies as follows:

firebase                          *7.3.0                 -                      -                      7.3.3
firebase_core                     *0.5.0                 0.5.3                  0.5.3                  0.5.3
firebase_core_platform_interface  *2.0.0                 2.1.0                  2.1.0                  2.1.0
firebase_core_web                 *0.2.0                 0.2.1+1                0.2.1+1                0.2.1+1

I don't like that I'm in a place where flutter pub upgrade breaks my build. And I'm nearly positive that other people are having the same issue I am having where they don't update their plugins (like firebase_ml_vision), but, flutter pub upgrade breaks their build. So, I'm going to try to find a set of fixed versions that work. (git reset --hard && flutter clean && flutter pub get) BRB.

Alright, I updated my pubspec.yaml to the following:

  firebase_core: 0.5.0
  firebase_messaging: 7.0.2
  firebase_ml_vision: 0.9.7

I can flutter pub upgrade and flutter run and it will build and run. So, the above is what people that aren't ready to upgrade yet might want to put in their pubspec.yaml.

Now, let's see if I can update and get it working with the newest version of the two Firebase plugins that we are using.

  firebase_core: 0.5.3
  firebase_messaging: 7.0.3
  firebase_ml_vision: 0.9.10

flutter pub get && flutter run. Updating to the versions above caused the error that I posted above. Following @comyuno's example, I updated the build.gradle as follows:

// From (Broke)
dependencies {
    api 'com.google.firebase:firebase-ml-vision-face-model:17.0.2'
    implementation 'com.google.firebase:firebase-core:17.2.0'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

// To (Works)
dependencies {
    api 'com.google.firebase:firebase-ml-vision-face-model:20.0.2'
    implementation 'com.google.android.gms:play-services-vision:20.1.1'
    implementation 'com.google.android.gms:play-services-vision-common:19.1.1'
    implementation 'com.google.android.gms:play-services-vision-image-label:18.0.5'
    implementation 'com.google.android.gms:play-services-vision-face-contour-internal:16.0.2'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

With the 3 fixed versions of the Firebase plugin deps in my pubspec.yaml and the updated deps in my build.gradle, I can now flutter pub upgrade && flutter clean && flutter run and everything works.

I hope this is helpful to the Firebase plugin authors (and anyone that was stuck like I was). It feels like there should have been somethign in the changlog for firebase_ml_vision (somewhere between versions 0.9.7 and 0.9.10) explaining what changes are required in the build.gradle file. (I always run flutter pub outdated and then read all the changlogs for the dependencies before I update them.)

@manzoorfarmani
Copy link

I solved it this way.
implementation 'com.google.android.gms:play-services-vision:20.1.2'
implementation 'com.google.android.gms:play-services-vision-common:19.1.2'
implementation 'com.google.android.gms:play-services-vision-image-label:18.1.0'
Captura de Pantalla 2020-10-31 a la(s) 10 48 55 p  m

Somehow this solved my issue, thank you

This Solve my issue..

@firebase firebase locked and limited conversation to collaborators Jun 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: android Issues / PRs which are specifically for Android. plugin: ml_vision type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests