Swati
Swati

Reputation: 31

Getting error for Play services and Firebase version

In my app build.gradle I have this settings

buildscript {
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
        classpath 'com.google.gms:google-services:4.0.1'
    }

    repositories {
        jcenter()
        maven {
            url "https://maven.google.com"
        }
        maven {
            url 'https://jitpack.io'
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }
}

ext {
    supportlib_version = '26.0.2'
    gps_version = '15.0.2'
}

And in my other gradle file I have integrated these libraries

dependencies {

implementation fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.devbrackets.android:exomedia:4.0.3'
//Radio
compile 'com.squareup.okhttp3:okhttp:3.3.1'
//WC
compile 'org.jsoup:jsoup:1.8.3'
compile 'com.onesignal:OneSignal:[3.6.0,4.0.0)'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.booking:rtlviewpager:1.0.1'
compile 'com.github.apg-mobile:android-round-textview:v0.0.3'
compile 'com.github.chrisbanes:PhotoView:1.3.0'
compile 'com.google.code.gson:gson:2.8.0'
//TV & Radio
compile "com.android.support:cardview-v7:$supportlib_version"
compile "com.android.support:appcompat-v7:$supportlib_version"
compile "com.android.support:recyclerview-v7:$supportlib_version"
compile "com.android.support:design:$supportlib_version"
compile "com.android.support:support-v4:$supportlib_version"
compile "com.android.support:support-core-utils:$supportlib_version"
compile "com.android.support:support-media-compat:$supportlib_version"
implementation 'com.google.firebase:firebase-messaging:15.0.2'
compile "com.google.android.gms:play-services-gcm:$gps_version"
compile "com.google.android.gms:play-services-ads:$gps_version"

}

Getting this error on build - Failed to resolve: com.google.android.gms:play-services-gcm:15.0.2 Install Repository and sync project

When I try to install its gives error that The repository could not be found

Please suggest what version should I use for proper build.

Upvotes: 0

Views: 368

Answers (1)

zfromg
zfromg

Reputation: 170

There is no 15.0.2 version of play-services-gcm now (see http://maven.google.com).

Also, your use of a $gps_version variable is now discouraged for this exact reason; Play services libraries will iterate at different release cycles with different versions. See the latest guidance: https://developers.google.com/android/guides/versioning#remove_old_anti_pattern

Upvotes: 1

Related Questions