Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

com.google.gms:google-services Compatibility Issue - com.google.firebase:firebase-iid is being requested by various other libraries at [[15.1.0,15.1.0]], but resolves to 16.0.0 #37

Closed
sannyo opened this issue May 24, 2018 · 36 comments
Labels

Comments

@sannyo
Copy link

sannyo commented May 24, 2018

After updating to the semantinc versioning the OneSignal Gradle plugin fails.
When I remove the OneSignal gradle plugin (v0.10.1) the sync succeed, otherwise it fails with the following error.

Full Error

BUILD ERROR
<ij_msg_gr>Gradle import errors<ij_msg_gr><ij_nav><project_path>/app/build.gradle<ij_nav><i><b>project ':app': Unable to build Kotlin project configuration</b><eol>Details: java.lang.reflect.InvocationTargetException: null<eol>Caused by: org.gradle.api.GradleException: The library com.google.firebase:firebase-iid is being requested by various other libraries at [[15.1.0,15.1.0]], but resolves to 16.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.</i>
The library com.google.firebase:firebase-iid is being requested by various other libraries at [[15.1.0,15.1.0]], but resolves to 16.0.0. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

Dependency Tree

The firebase com.google.firebase:firebase-iid package is referenced from the dependencies below.

+--- com.google.firebase:firebase-core:16.0.0
|    +--- com.google.firebase:firebase-analytics:16.0.0
|    |    +--- com.google.android.gms:play-services-basement:15.0.1 (*)
|    |    +--- com.google.android.gms:play-services-measurement-base:[15.0.4] -> 15.0.4
|    |    +--- com.google.android.gms:play-services-stats:15.0.1
|    |    |    \--- com.google.android.gms:play-services-basement:[15.0.1] -> 15.0.1 (*)
|    |    +--- com.google.firebase:firebase-analytics-impl:[16.0.0] -> 16.0.0
|    |    |    +--- com.google.android.gms:play-services-ads-identifier:15.0.1
|    |    |    |    \--- com.google.android.gms:play-services-basement:[15.0.1,16.0.0) -> 15.0.1 (*)
|    |    |    +--- com.google.android.gms:play-services-basement:15.0.1 (*)
|    |    |    +--- com.google.android.gms:play-services-measurement-base:[15.0.4] -> 15.0.4
|    |    |    +--- com.google.android.gms:play-services-stats:15.0.1 (*)
|    |    |    +--- com.google.android.gms:play-services-tasks:15.0.1 (*)
|    |    |    +--- com.google.firebase:firebase-common:16.0.0
|    |    |    |    +--- com.google.android.gms:play-services-basement:15.0.1 (*)
|    |    |    |    \--- com.google.android.gms:play-services-tasks:15.0.1 (*)
|    |    |    \--- com.google.firebase:firebase-iid:16.0.0
|    |    |         +--- com.google.android.gms:play-services-basement:15.0.1 (*)
|    |    |         +--- com.google.android.gms:play-services-stats:15.0.1 (*)
|    |    |         +--- com.google.android.gms:play-services-tasks:15.0.1 (*)
|    |    |         +--- com.google.firebase:firebase-common:16.0.0 (*)
|    |    |         \--- com.google.firebase:firebase-iid-interop:16.0.0
|    |    |              +--- com.google.android.gms:play-services-base:15.0.1 (*)
|    |    |              \--- com.google.android.gms:play-services-basement:15.0.1 (*)
|    |    \--- com.google.firebase:firebase-common:16.0.0 (*)
|    \--- com.google.firebase:firebase-measurement-connector-impl:16.0.0
|         +--- com.google.android.gms:play-services-basement:15.0.1 (*)
|         +--- com.google.android.gms:play-services-measurement-base:[15.0.4] -> 15.0.4
|         +--- com.google.firebase:firebase-analytics:[16.0.0] -> 16.0.0 (*)
|         +--- com.google.firebase:firebase-analytics-impl:[16.0.0] -> 16.0.0 (*)
|         +--- com.google.firebase:firebase-common:16.0.0 (*)
|         \--- com.google.firebase:firebase-measurement-connector:16.0.0
|              \--- com.google.android.gms:play-services-basement:15.0.1 (*)

And

--- com.onesignal:OneSignal:3.9.1
|    +--- com.google.firebase:firebase-messaging:[10.2.1, 12.1.0) -> 12.0.1
|    |    +--- com.google.firebase:firebase-iid:12.0.1 -> 16.0.0 (*)
|    |    +--- com.google.android.gms:play-services-basement:12.0.1 -> 15.0.1 (*)
|    |    +--- com.google.firebase:firebase-common:12.0.1 -> 16.0.0 (*)
|    |    \--- com.google.firebase:firebase-messaging-license:12.0.1
|    +--- com.android.support:support-v4:[26.0.0, 27.2.0) -> 27.1.1 (*)
|    +--- com.android.support:customtabs:[26.0.0, 27.2.0) -> 27.1.1 (*)
|    +--- com.google.android.gms:play-services-location:[10.2.1, 12.1.0) -> 12.0.1
|    |    +--- com.google.android.gms:play-services-base:12.0.1 -> 15.0.1 (*)
|    |    +--- com.google.android.gms:play-services-basement:12.0.1 -> 15.0.1 (*)
|    |    +--- com.google.android.gms:play-services-tasks:12.0.1 -> 15.0.1 (*)
|    |    \--- com.google.android.gms:play-services-location-license:12.0.1
|    \--- com.google.android.gms:play-services-base:[10.2.1, 12.1.0) -> 15.0.1 (*)
@jkasten2
Copy link
Member

jkasten2 commented May 24, 2018

@sannyo Looks like you are using the com.google.android.gms:strict-version-matcher-plugin Gradle plugin as well in your project? Can you attach your full root build.gradle and your app/build.gradle so we can reproduce the issue?

Both this plugin and the strict version matcher solves the same problem of mismatched versions but in different ways. This plugin aligns versions automatically by upgrading them but the strict plugin errors on any mismatches. In this case I recommend removing either this plugin or the strict version matcher plugin.

@sannyo
Copy link
Author

sannyo commented May 25, 2018

@jkasten2 Thanks for the reply.
Ohh I see now. I am not explicitly using the strict-version-matcher-plugin but the plugin is part of the 'com.google.gms:google-services:4.0.0' plugin so basically the problem is what you mentioned.
It is pretty easy to reproduce, but you need to have a project/app created in Firebase and to have a google-services.json so the other plugin could function normally.

I created a gist with the minimal config to be able to reproduce the issue.
Hope it helps.

@jkasten2
Copy link
Member

jkasten2 commented May 25, 2018

@sannyo Ah yes, the google-services plugin also has the same logic. Thanks for the details, I was able to reproduce the issue. I'll see what we can do in this case to make sure this gradle plugin is compatible with this.

In the mean time, right after the apply plugin: 'com.google.gms.google-services' at the bottom of your build.gradle the following can be added to work around the issue.

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true

https://gist.github.com/jkasten2/2c63ce79c03cac4943e240a46cea218c#file-build-gradle-L45-L47

Also the google-services plugin isn't required to use OneSignal, so anther work around option could be to remove it if you don't need it for any other part of your project.

Update

Starting with com.google.gms:google-services:4.3.0 you must now instead add the following to the bottom of your app/build.gradle, after the apply.

googleServices { disableVersionCheck = true }

This also works with previous version of com.google.gms:google-services.

@jkasten2 jkasten2 changed the title he library com.google.firebase:firebase-iid is being requested by various other libraries at [[15.1.0,15.1.0]], but resolves to 16.0.0. com.google.gms:google-services Compatibility Issue - com.google.firebase:firebase-iid is being requested by various other libraries at [[15.1.0,15.1.0]], but resolves to 16.0.0 May 25, 2018
@jkasten2 jkasten2 added the Bug label May 25, 2018
@jkasten2
Copy link
Member

jkasten2 commented Jun 6, 2018

@sannyo We set disableVersionCheck flag to true to resolve this build error in the PR above. This is due to both trying to solve the same fundamental problem of mismatched version handling but in two different incompatible ways as noted above in my #37 (comment) post

@vishrut2207
Copy link

Try to set

classpath 'com.google.gms:google-services:3.2.1'
instead of

classpath 'com.google.gms:google-services:3.3.0'
It's helped in my case, but I don't know the cause of the error.

@jkasten2
Copy link
Member

@vishrut2207 The error is due to version checks Google added in version 3.3.0 of their com.google.gms:google-services Gradle Plugin. It's very strict on failing the build if any dependencies override any other module versions.

This OneSignal plugin however upgrades or downgrades packages automatically instead when possible so you don't need to manually fix version conflicts on your own.

@btwarog
Copy link

btwarog commented Jul 13, 2018

It's working for normal app version, but it's not working for test application, I mean instrumented tests. Even workaround does not help.

@jkasten2
Copy link
Member

jkasten2 commented Jul 13, 2018

@btwarog Can you share your build.gradle files so we can look into reproducing the issue?

@marioskonstantinou12
Copy link

@jkasten2 your solution seems to be working for me. Would you mind elaborating why this works please?

@JacobMGEvans
Copy link

JacobMGEvans commented Jul 28, 2018

@marioskonstantinou @jkasten2 Maybe gradle clean is necessary? cd android/ && ./gradlew :app:clean --info

Not sure if it will help but if it is working on another machine, just maybe it's a dirty environment.

EDIT: flag disabling the version check fixed my issue as well. Thanks @marioskonstantinou

@saadmutahar
Copy link

saadmutahar commented Aug 16, 2018

Can someone please help me out to solve gradle build error.

These are the build.gradle and error files.
error

build gradle project

@jkasten2
Copy link
Member

@saadmutahar Can you run the following and provide the full output?
./gradlew app:dependencies --info

Also please provide text versions of your screenshots above, we can try your config but will need it to be copy-pasteable

@btwarog
Copy link

btwarog commented Aug 23, 2018

@jkasten2
I found the cause of the issue, I had in build.gradle newest version of firebase-messaging, firebase-core and play-services-analytics added by myself and they were working as they supposed but it occurred that your OneSignal library is adding play-services-location in old version, not supported by newest google play services plugin. The resolution of the issue was adding com.google.android.gms:play-services-location:15.0.1 version in build.gradle by myself.

Below you can see tree dependency when location-services wasn't added by myself in build.gradle.

+--- com.onesignal:OneSignal:[3.8.1, 3.99.99] -> 3.10.1
| +--- com.google.firebase:firebase-messaging:[10.2.1, 12.1.0) -> 17.3.0 ()
| +--- com.android.support:support-v4:[26.0.0, 27.2.0) -> 27.1.1 (
)
| +--- com.android.support:customtabs:[26.0.0, 27.2.0) -> 27.1.1
| | +--- com.android.support:support-compat:27.1.1 ()
| | +--- com.android.support:support-annotations:27.1.1
| | --- com.android.support:support-core-ui:27.1.1 (
)
| +--- com.google.android.gms:play-services-location:[10.2.1, 12.1.0) -> 12.0.1
| | +--- com.google.android.gms:play-services-base:12.0.1 -> 15.0.1 ()
| | +--- com.google.android.gms:play-services-basement:12.0.1 -> 15.0.1 (
)
| | +--- com.google.android.gms:play-services-tasks:12.0.1 -> 15.0.1 ()
| | --- com.google.android.gms:play-services-location-license:12.0.1
| --- com.google.android.gms:play-services-base:[10.2.1, 12.1.0) -> 15.0.1 (
)

You can see that com.google.android.gms:play-services-location isn't updating to version 15.0.1.

@jkasten2
Copy link
Member

@btwarog I have seen older versions being used on the compile target. However once it gets to the build types step of either debug or release the correct version will be used. Try checking or selectively running debugCompileClasspath.

./gradlew app:dependencies --info --configuration debugCompileClasspath

You should then see this;

debugCompileClasspath - Resolved configuration for compilation for variant: debug
...
+--- com.onesignal:OneSignal:[3.8.1, 3.99.99] -> 3.10.1
|    +--- com.google.firebase:firebase-messaging:[10.2.1, 12.1.0) -> 17.0.0 (*)
|    +--- com.android.support:support-v4:[26.0.0, 27.2.0) -> 27.1.1 (*)
|    +--- com.android.support:customtabs:[26.0.0, 27.2.0) -> 27.1.1
|    |    +--- com.android.support:support-compat:27.1.1 (*)
|    |    +--- com.android.support:support-annotations:27.1.1
|    |    \--- com.android.support:support-core-ui:27.1.1 (*)
|    +--- com.google.android.gms:play-services-location:[10.2.1, 12.1.0) -> 15.0.1
|    |    +--- com.google.android.gms:play-services-base:[15.0.1,16.0.0) -> 15.0.1 (*)
|    |    +--- com.google.android.gms:play-services-basement:[15.0.1,16.0.0) -> 15.0.1 (*)
|    |    +--- com.google.android.gms:play-services-places-placereport:[15.0.1,16.0.0) -> 15.0.1
|    |    |    \--- com.google.android.gms:play-services-basement:[15.0.1,16.0.0) -> 15.0.1 (*)
|    |    \--- com.google.android.gms:play-services-tasks:[15.0.1,16.0.0) -> 15.0.1 (*)
|    \--- com.google.android.gms:play-services-base:[10.2.1, 12.1.0) -> 15.0.1 (*)
\--- com.android.support:multidex:1.0.2

@saadmutahar
Copy link

saadmutahar commented Aug 27, 2018

@jkasten2
I noticed the main issue is the conflict between 'com.github.ar-android:DrawRouteMaps:1.0.0' and 'com.google.android.gms:play-services:15.0.0'.

If I remove 'com.github.ar-android:DrawRouteMaps:1.0.0', then it's working fine.

Two weeks ago this same code was working, then suddenly stop building.

fulloutput.docx

buildGradleProject.docx

@jkasten2
Copy link
Member

@saadmutahar Thanks for reporting. Can you provide a gist of these instead of using .docx files? We can look into this after you provide this, Thanks.

@saadmutahar
Copy link

@jkasten2 Yes of-course. This is a gist for all three files.
https://gist.github.com/saadmutahar/c8891652f29377be3275ae4e31700b27

Thank you.

@jkasten2
Copy link
Member

@saadmutahar Thanks for the details. I found the root of the issue and created a ticket on DrawRouteMaps's github issue tracker with a possible work around.
ar-android/DrawRouteMaps#20

I also created an issue on this repo to automatically resolve a dependency mismatch like this in the future.
#62

@sumeetnsit
Copy link

sumeetnsit commented Sep 26, 2018

@jkasten2 I am facing a similar issue need help urgently ,

below is the error I am facing

The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.4,15.0.4], [16.0.2,16.0.2]], but resolves to 16.0.2. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

this is my stacktree
myLog.txt

this is my gradle file
https://gist.github.com/sumeetnsit/6379c13f82763d7741f2e46a4965975c

@jkasten2
Copy link
Member

@saadmutahar The error you are seeing is from com.google.gms.google-services plugin. I didn't see it in your gist but it Google tells you to add it to the last line so maybe you miss copied your `build.gralde.
https://developers.google.com/android/guides/google-services-plugin

You can disable the version check by adding the following noted above #37 (comment). If you are using this OneSignal plugin you don't need to add this as this plugin automatically disable the version checking part of it with the same setting.

@pauldaviddavies
Copy link

I did two things:

In the project level gradle change the version of com.google.gms:google-services:4.0.1 to com.google.gms:google-services:4.2.0
In the app level gradle, change the version of com.google.firebase:firebase-core:16.0.1 to com.google.firebase:firebase-core:16.0.5

@kalraneeraj24550
Copy link

The library com.google.android.gms:play-services-base is being requested by various other libraries at [[10.2.4,10.2.4]], but resolves to 15.0.1. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.
i am facing error , anyone plz help me

@saadmutahar
Copy link

saadmutahar commented Dec 28, 2018 via email

@dwisusanto
Copy link

Try to set

classpath 'com.google.gms:google-services:3.2.1'
instead of

classpath 'com.google.gms:google-services:3.3.0'
It's helped in my case, but I don't know the cause of the error.

works for me

@akashjadhav1221
Copy link

akashjadhav1221 commented Feb 4, 2019

For Ionic cordova build android
Install plugin - cordova-android-play-services-gradle-release
Set -
"cordova-android-play-services-gradle-release": {
"PLAY_SERVICES_VERSION": "+"
}
In package.json

& set -

 <plugin name="cordova-android-play-services-gradle-release" spec="^2.0.0">
        <variable name="PLAY_SERVICES_VERSION" value="+" />
    </plugin>

in config.xml

@JoseGeorges8
Copy link

@akashjadhav1221 answer for ionic solved it properly!

@segicm
Copy link

segicm commented Feb 18, 2019

This helped me with my Ionic project.
https://stackoverflow.com/a/54751193/8826537

@vagnersabadi
Copy link

vagnersabadi commented Jan 10, 2020

For ionic 4 solved with:

rm -Rf platforms/android
rm -Rf plugins/ node_modules/
npm cache clean
npm install
ionic cordova run android -l --ssl --debug

@nagralepia
Copy link

implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'

chnge version to according to hint given on bubble

@nagralepia
Copy link

mine one
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'

@Barlium
Copy link

Barlium commented Oct 19, 2020

Can someone help me with the gradle build error? I tried reproducing all above mentioned steps, including the disabledVersion Check Flag, but its not working.
Output when I try to build:
`flutter build apk
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:processReleaseResources'.

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:firebase-bom@{strictly 25.12.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}

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 = true }" to your bu
ild.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
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 2.2s
Gradle task assembleRelease failed with exit code 1`

my build.gradle on app level:
`def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 28

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
    disable 'InvalidPackage'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.WoerterbuchSchwaebisch"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.debug
    }
}

}

flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:25.12.0')
implementation 'com.google.firebase:firebase-analytics'
}
`

My build.gradle on application level:
`buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:4.0.2'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.4'
    
}

}

allprojects {
repositories {
google()
jcenter()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}

`

I´ve added the google-services.json file aswell, as described by firebases instructions.

@justjcool
Copy link

Can someone help me with the gradle build error? I tried reproducing all above mentioned steps, including the disabledVersion Check Flag, but its not working.
Output when I try to build:
`flutter build apk
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:processReleaseResources'.

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:firebase-bom@{strictly 25.12.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}

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 = true }" to your bu
ild.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
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 2.2s
Gradle task assembleRelease failed with exit code 1`

my build.gradle on app level:
`def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 28

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
    disable 'InvalidPackage'
}

defaultConfig {
    // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
    applicationId "com.example.WoerterbuchSchwaebisch"
    minSdkVersion 21
    targetSdkVersion 28
    versionCode flutterVersionCode.toInteger()
    versionName flutterVersionName
}

buildTypes {
    release {
        // TODO: Add your own signing config for the release build.
        // Signing with the debug keys for now, so `flutter run --release` works.
        signingConfig signingConfigs.debug
    }
}

}

flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:25.12.0')
implementation 'com.google.firebase:firebase-analytics'
}
`

My build.gradle on application level:
`buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:4.0.2'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.4'
    
}

}

allprojects {
repositories {
google()
jcenter()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}

`

I´ve added the google-services.json file aswell, as described by firebases instructions.

I am facing the same issue. did you found any solution?

@Barlium
Copy link

Barlium commented Nov 2, 2020 via email

@justjcool
Copy link

So far I didnt 🙁

________________________________ Von: justjcool [email protected] Gesendet: Montag, 2. November 2020 12:17 An: OneSignal/OneSignal-Gradle-Plugin [email protected] Cc: Barlium [email protected]; Comment [email protected] Betreff: Re: [OneSignal/OneSignal-Gradle-Plugin] com.google.gms:google-services Compatibility Issue - com.google.firebase:firebase-iid is being requested by various other libraries at [[15.1.0,15.1.0]], but resolves to 16.0.0 (#37) Can someone help me with the gradle build error? I tried reproducing all above mentioned steps, including the disabledVersion Check Flag, but its not working. Output when I try to build: flutter build apk 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:processReleaseResources'. 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:firebase-bom@{strictly 25.12.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} 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 = true }" to your bu ild.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 Running Gradle task 'assembleRelease'... Running Gradle task 'assembleRelease'... Done 2.2s Gradle task assembleRelease failed with exit code 1 my build.gradle on app level: def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { localPropertiesFile.withReader('UTF-8') { reader -> localProperties.load(reader) } } def flutterRoot = localProperties.getProperty('flutter.sdk') if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' } def flutterVersionName = localProperties.getProperty('flutter.versionName') if (flutterVersionName == null) { flutterVersionName = '1.0' } apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" apply plugin: 'com.google.gms.google-services' android { compileSdkVersion 28 sourceSets { main.java.srcDirs += 'src/main/kotlin' } lintOptions { disable 'InvalidPackage' } defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.WoerterbuchSchwaebisch" minSdkVersion 21 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } buildTypes { release { // TODO: Add your own signing config for the release build. // Signing with the debug keys for now, so flutter run --releaseworks. signingConfig signingConfigs.debug } } } flutter { source '../..' } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation platform('com.google.firebase:firebase-bom:25.12.0') implementation 'com.google.firebase:firebase-analytics' } My build.gradle on application level: buildscript { ext.kotlin_version = '1.3.50' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:4.0.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'com.google.gms:google-services:4.3.4' } } allprojects { repositories { google() jcenter() } } rootProject.buildDir = '../build' subprojects { project.buildDir = "${rootProject.buildDir}/${project.name}" } subprojects { project.evaluationDependsOn(':app') } task clean(type: Delete) { delete rootProject.buildDir } I´ve added the google-services.json file aswell, as described by firebases instructions. I am facing the same issue. did you found any solution? — You are receiving this because you commented. Reply to this email directly, view it on GitHub<#37 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJIO5Q4NIR3US4ITX45ZAGLSN2IL3ANCNFSM4FBQ42NA.

I'm trying to fix this from the last 3 days. tried each and every solution but did not work.

@jkasten2
Copy link
Member

jkasten2 commented Dec 5, 2020

@justjcool @Barlium The important part of the error message is this part

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.

This means you need to do one of the following:

This is just based on the error message in your log, OneSignal doesn't use Google's Vision libraries so it is out of scope of this repo / project. If that doesn't help recommend opening a question through Google's developer help channels or another more generic forum such as Stackoverflow.

@Barlium
Copy link

Barlium commented Dec 31, 2020

@jkasten2 Thanks! Worked.
In the app level build.gradle-file I added unter dependencies{...} the specific implementations shown in my error messages.
For the error message
Dependency failing: com.google.android.gms:play-services-vision:20.0.0 -> com.google.android.gms:play-services-vision-common@[19.0.2], but play-services-vision-common version was 19.1.0.
I added
implementation 'com.google.android.gms:play-services-vision-common:19.1.1'
to the dependencies. Works fine now.

FYI: The disabledVersion Check Flag didnt change anything for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests