SimpleJ
SimpleJ

Reputation: 14768

Can't find google-play-services version that corresponds to firebase-messaging version

From what I understand, in order to use firebase messaging I need my google-play-services version to match my firebase-messaging version in my app's build.gradle. According to Google's Firebase setup guide the firebase version I should use is 17.3.0, so I figure I'm supposed to use google-play-services version 17.3.0, but that doesn't work because Android Studio can't find that version:

missing google play services dependencies

Here is how I've added them to app/build.gradle:

dependencies {
    implementation fileTree(dir: 'libs', include: '*.jar')
    implementation 'com.android.volley:volley:1.1.1'
    implementation 'com.google.android.gms:play-services:17.3.0'
    implementation 'com.google.firebase:firebase-messaging:17.3.0'

    // SUB-PROJECT DEPENDENCIES START
    implementation(project(path: ":CordovaLib"))
    implementation "com.android.support:support-v4:24.1.1+"
    // SUB-PROJECT DEPENDENCIES END
}

What am I doing wrong here?

Upvotes: 0

Views: 1177

Answers (1)

tyczj
tyczj

Reputation: 73751

From what I understand, in order to use firebase messaging I need my google-play-services version to match my firebase-messaging version

That is no longer true, google recently changed to semantic versioning so libraries are no longer tied to the same version. 12.0.1 I believe was the last version that you could make the same version for everything play services related and everything else must follow the new versioning system

https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html

You can check googles maven repository for the latest version of any library

https://dl.google.com/dl/android/maven2/index.html

Also you should not include all of google play services in your project and you should only declare the libraries you need as this makes your app smaller.

Upvotes: 2

Related Questions