React-native-onesignal: Could not find com.google.android.gms:play-services-ads-identifier:12.0.1.

Created on 28 Jan 2020  ·  3Comments  ·  Source: OneSignal/react-native-onesignal

Description:
I updated react-native-onesignal 3.6.3 from 3.4.0 and I followed the instructions but when I run react-native run-android it fails with the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':react-native-onesignal:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':react-native-onesignal:debugCompileClasspath'.
   > Could not find com.google.android.gms:play-services-ads-identifier:12.0.1.
     Required by:
         project :react-native-onesignal > com.onesignal:OneSignal:3.12.5

Environment

  1. OneSignal React-Native SDK: "3.6.3"
  2. SDK: 28
  3. React Native: "0.61.2"

Anything else:
There is a similar issue: https://github.com/OneSignal/react-native-onesignal/issues/938 but it doesn't help me.

Most helpful comment

@HristoEftimov Please double check you have correctly added the OneSignal Gradle Plugin as it normally resolves issues like this.
https://documentation.onesignal.com/docs/react-native-sdk-setup#section-adding-the-gradle-plugin

If not you can run the following to see what resulted in picking that specific version:
./gradlew app:dependencies --info

The issue is most likely another plugin picking an old version if the above does not help. Also check for resolutionStrategy anywhere in your project or node_modules as this can be forcing an old version.

All 3 comments

@HristoEftimov Please double check you have correctly added the OneSignal Gradle Plugin as it normally resolves issues like this.
https://documentation.onesignal.com/docs/react-native-sdk-setup#section-adding-the-gradle-plugin

If not you can run the following to see what resulted in picking that specific version:
./gradlew app:dependencies --info

The issue is most likely another plugin picking an old version if the above does not help. Also check for resolutionStrategy anywhere in your project or node_modules as this can be forcing an old version.

@jkasten2 Thank you very much for the answer. The ./gradlew app:dependencies --info helped me a lot find the dependency that requires this 12.0.1 version 🌞

I usually use this command to check any issue in gradle

./gradlew test

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LuckyLuky picture LuckyLuky  ·  35Comments

tavriaforever picture tavriaforever  ·  36Comments

mnmeyers picture mnmeyers  ·  32Comments

wkoutre picture wkoutre  ·  30Comments

williamrijksen picture williamrijksen  ·  29Comments