Pimmesz
Pimmesz

Reputation: 575

React-Native - Could not find com.google.android.gms:play-services-analytics:15.0.1

When trying to install Pushnotifications for Android in a React Native project I get the following error during building

Could not find com.google.android.gms:play-services-analytics:15.0.1.

I cannot find the place where I would require play-services-analytics. Anyone a clue how I could solve this issue?

Upvotes: 0

Views: 1106

Answers (1)

Nerdragen
Nerdragen

Reputation: 3194

I had the same issue. Sometimes, the dependency version used by a package is no longer the recommended minimum that's been pushed by Google. To fix, locate the build.gradle file for the package that is giving you the error (in this case, it should be react-native-push-notification) and change locate the line that contains play-services-analytics under the dependencies, then change the version number to the recommended minimum version listed here. For play-services-analytics, it should be 16.0.5. Here's how it should look like afterward

implementation "com.google.android.gms:play-services-analytics:${safeExtGet('googlePlayServicesVersion', '16.0.5')}"

By far, the easiest way I've found to debug these package error is to get Android Studio. When you run the App from there, it'll error out on any dependency error and open up the gradle file for you, then you just have to fix it.

Upvotes: 1

Related Questions