Onesignal-android-sdk: ERROR: Failed to resolve: com.google.android.gms:play-services-ads-identifier:11.8.0 ERROR: Failed to resolve: com.google.firebase:firebase-measurement-connector:11.8.0

Created on 23 Oct 2019  路  5Comments  路  Source: OneSignal/OneSignal-Android-SDK

Description:
Getting following issue when gradle project sync

ERROR: Failed to resolve: com.google.android.gms:play-services-ads-identifier:11.8.0
Show in Project Structure dialog
Affected Modules: app

ERROR: Failed to resolve: com.google.firebase:firebase-measurement-connector:11.8.0
Show in Project Structure dialog
Affected Modules: app

Environment

Steps to Reproduce Issue:
using onesignal 'com.onesignal:OneSignal:3.12.1'

Possible Bug

Most helpful comment

@jkasten2 my bad, i pasted the plugin reference instead of the actual dependency:
implementation 'com.onesignal:OneSignal:[3.11.2, 3.99.99]'
I argue that this is a bad way of defining a dependency and your users shouldn't be told to do so

All 5 comments

@gitton This looks to be a bug with our OneSignal-Gradle-Plugin picking the wrong version. Until the issue can be fixed can you try the following?

  1. We changed our dependencies in OneSignal-Android-SDK 3.12.2 that may result a compatible set of dependencies.

  2. If that does not help I recommend updating your other firebase and gms dependencies to version 15.0.0 or newer which should fix the issue.

@jkasten2 i would say this is entirely due to your installation guide instructing users to specify the Onesignal dependency dynamically, as such:
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.12.4, 0.99.99]'
It's a nightmare to work with projects suddenly breaking due to a dependencies being updated with breaking-changes. I think you should either specify one single version for users to use, or at least limit it to [0.12.4, 0.12.99] and keep version 0.12 free from breaking changes like these

@sebastiant The issue is related to us updating the dependencies in OneSignal-Android-SDK 3.12.X. The onesignal-gradle-plugin isn't accounting for a mixture of 11.8.0 and 15+ of Firebase and gms. Basically the updated dependencies ranges introduced inOneSignal-Android-SDK 3.12.X uncovered a bug in onesignal-gradle-plugin.

The onesignal-gradle-plugin isn't required to use OneSignal-Android-SDK. onesignal-gradle-plugin was created to fix a compile and runtime errors due to a mixture of dependencies without requiring the developer to resolve the issue manually. Gradle has a flaw explained in detail in https://github.com/gradle/gradle/issues/10170 which doesn't find a compatible parent when a child dependency is upgraded, which is the largest problem onesignal-gradle-plugin is design to solve.

@jkasten2 my bad, i pasted the plugin reference instead of the actual dependency:
implementation 'com.onesignal:OneSignal:[3.11.2, 3.99.99]'
I argue that this is a bad way of defining a dependency and your users shouldn't be told to do so

Thanks for your suggestion. This seems safe to close. Just comment if you would like to reopen

Was this page helpful?
0 / 5 - 0 ratings