facundomedica / fast_qr_reader_view

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

Dependency issue importing library #11

Closed martflu closed 5 years ago

martflu commented 5 years ago
FAILURE: Build failed with an exception.
* What went wrong:
Failed to capture snapshot of input files for task ':app:preDebugBuild' property 'compileManifests' during up-to-date check.
> The library com.google.android.gms:play-services-auth-base is being requested by various other libraries at [[15.0.1,15.0.1]], but resolves to 15.1.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
* 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
Gradle task assembleDebug failed with exit code 1

This seems to be related to google_sign_in: ^3.2.2 which is also in the pubspec of your project. I could not find where the play-services-auth-base version is specified.

facundomedica commented 5 years ago

Hi! I don't see where google_sign_in: ^3.2.2 is used. Maybe other library you are importing has conflicting dependencies?

martflu commented 5 years ago

Sorry. That was meant to say "pubspec of our project".

martflu commented 5 years ago

So when I remove either the google_sign_in or the fast_qr_reader_view from the pubspec.yaml, the app successfully builds. Do you have a tip on how to resolve this? I tried downgrading to gradle:3.0.1 and google-services:4.0.2 which is used in the example. I also tried adding minSdkVersion 21 to the android/app/build.gradle, but the dependency problem seems unrelated to that. Do you know where the version of play-services-auth-base is specified?

martflu commented 5 years ago
* What went wrong:
Failed to capture snapshot of input files for task ':app:checkDebugClasspath' property 'compileClasspath' during up-to-date check.
> 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-auth:15.0.1 -> com.google.android.gms:play-services-auth-base@[
  15.0.1], but play-services-auth-base version was 15.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 on project 'fast_qr_reader_view' which depends onto com.google.firebase:firebase-ml-vision@17.0
  .0
  -- Project 'app' depends on project 'google_sign_in' which depends onto com.google.android.gms:play-services-auth@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.

So it seems the problem is the dependency on com.google.firebase:firebase-ml-vision:17.0.0.

facundomedica commented 5 years ago

I don't have an answer to this yet, as it seems to be something related to Google's libraries. A quick fix might be forking this library or google_sign_in, changing the faulty dependency and then using it from your git URL like this:

dependencies:
  fast_qr_reader_view:
    git:
      url: git://github.com/martflu/fast_qr_reader_view.git

At least until we find the real cause and fix it.

Also, uploading a failing example to a Github repo would be nice to test!

martflu commented 5 years ago

I was able to resolve the dependency problems with following changes to google_sign_in and this PR: https://github.com/facundomedica/fast_qr_reader_view/pull/13