0

I tried to implement google play services but I am getting this error Failed to resolve: com.google.android.gms:play-services-stats:9.8.0

When I tried to install this, I encountered such a pop-up message could not find dependency 'com.google.android.gms:play-services-stats:9.8.0'

The features of the project as shown below::

compileSdkVersion 28
buildToolsVersion '28.0.3'
DKV
  • 1,767
  • 3
  • 28
  • 49
deniz baş
  • 75
  • 11
  • What are the dependencies you are using in your build.gradle? Or are you depending onto play-services-stats directly? Also note, Google Play services SDK is now served from maven.google.com (https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project) and have been for over a year now. – zfromg Dec 17 '18 at 18:16
  • Thanks I solved the problem. The problem happenned because of this if (details.getRequested().getGroup() == 'com.google.android.gms') { details.useVersion('9.8.0') } – deniz baş Dec 18 '18 at 09:18
  • did you solve your problem? – Radesh Dec 19 '18 at 07:25
  • Yes, I just added 'classpath 'com.google.gms:google-services:4.2.0'' and I removed this part (details.getRequested().getGroup() == 'com.google.android.gms') { details.useVersion('9.8.0') }.... By the way I encountered with this problem from a react-native projects – deniz baş Dec 19 '18 at 09:52

3 Answers3

0

Use this in your dependencies

implementation 'com.google.android.gms:play-services-stats:15.0.0'
Radesh
  • 13,084
  • 4
  • 51
  • 64
0

On Tools>SDK Manager>SDK Tools Check if Google Play Services is enabled, if not you have to install that first.

  • Note, Google Play services SDK is now served from maven.google.com (https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project) and has been for about a year now. – zfromg Dec 17 '18 at 18:17
0

Try to use latest gradle dependencies for your project. For more information visit below link which will help you.

Update Google Play ServiceDependenciess

Hemal Patel
  • 114
  • 1
  • 11