facundomedica / fast_qr_reader_view

A Fast QR Reader widget for Flutter. For both Android and iOS
MIT License
295 stars 163 forks source link

Works Great On iOS but many dependency errors building APK on Android #67

Closed daveparks23 closed 2 years ago

daveparks23 commented 4 years ago

Flutter Doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.11.0, on Mac OS X 10.15.1 19B88, locale en-US)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.40.2)
[✓] Connected device (2 available)

• No issues found!

Error from Debug Console:

Dependency failing: com.google.android.gms:play-services-vision-image-label:17.0.2 -> com.google.android.gms:play-servic
  es-vision-common@[17.0.2], but play-services-vision-common version was 18.0.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 on project 'firebase_ml_vision' which depends onto com.google.firebase:firebase-ml-vision@20.0.
  0
  -- Project 'app' depends onto com.google.android.gms:play-services-vision@{strictly 18.0.0}
  -- Project 'app' depends on project 'fast_qr_reader_view' which depends onto com.google.firebase:firebase-ml-vision@18.0
  .1
  -- Project 'app' depends onto com.google.firebase:firebase-ml-vision@{strictly 20.0.0}
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-image-label@{strictly 17.0.2}
  -- Project 'app' depends onto com.google.android.gms:play-services-vision-common@{strictly 18.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 15sGradle task assembleDebug failed with exit code 1 

Thanks for any direction on this issue.

jaddoescad commented 4 years ago

has anyone been able to resolve these dependency issues?

SoftWyer commented 4 years ago

I had similar dependency issues after adding firebase-admob as a dependency. I have forked the project and updated the dependencies of this project to support the latest firebase libraries.

This is the commit of the changes.

You can include this version in your projects by referencing the github URL in your pubspec.yaml, e.g.

  fast_qr_reader_view:
    git:
      url: git://github.com/SoftWyer/fast_qr_reader_view.git
      # url: git://github.com/facundomedica/fast_qr_reader_view.git

To be safe, you might want to investigate how to pull in a specific commit from a URL, just in case I change something later and break stuff.

I did notice that the example no longer worked for me if, with a Flutter error:

[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized.

You can either move the camera initialisation inside the initstate method of the widget, or call

WidgetsFlutterBinding.ensureInitialized();
jessetinell commented 4 years ago

@SoftWyer Additional info to your answer. Pull the specific commit by adding "ref":

  fast_qr_reader_view:
    git:
      url: git://github.com/SoftWyer/fast_qr_reader_view.git
      ref: 9b360e868026ddf880570e8b458ec26879fc8edb
      #url: git://github.com/facundomedica/fast_qr_reader_view.git

Hacky solution but might temporarily help someone.

The facundomedica-repo should definitely update firebase dependencies as well but it feels like this repo isn't maintained anymore. Might be worth creating a pull request anyways? If someone in the future decides to clone and create a new "official" version of this repo :)

facundomedica commented 4 years ago

Indeed this repo hasn't seen maintenance in a long time, I'll try to get back at it in the next few weeks; if I fail to do that I would like to give part ownership to someone that can make updates on it. That someone should be a company or at least a well known dev in the community, right?

nicolasvac commented 4 years ago

Hello @facundomedica. Have you got any news about maintaining the package ? The package now overrides deprecated APIs and has numerous bugs in it (which you can tell by the issues). Just to know if we need to migrate elsewhere or we can keep trusting this package.

facundomedica commented 2 years ago

Hey everyone, just did a big refactor which fixes all of this. Hopefully it's not thaaat late 😅