Tuesday, 28 August 2018

OneSignal causing Google Play Services version to change

I'm trying to integrate OneSignal into my project, but it's causing errors with Google Play Services.

This is my build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'

dependencies {
    ...

    implementation "com.google.firebase:firebase-core:16.0.1"
    implementation "com.google.firebase:firebase-messaging:17.3.0"

    implementation "com.google.android.gms:play-services-plus:15.0.1"
    implementation "com.google.android.gms:play-services-auth:15.0.1"
    implementation "com.google.android.gms:play-services-location:15.0.1"
    implementation "com.google.android.gms:play-services-maps:15.0.1"
    implementation "com.google.android.gms:play-services-places:15.0.1"
    implementation "com.google.android.gms:play-services-wallet:15.0.1"

    ...
}

apply plugin: 'com.google.gms.google-services'

Now, I added OneSignal.

buildscript {
    ...

    dependencies {
        ...

        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.8.1'

        ...
    }
}

And here is my updated build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'

apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'

dependencies {
    ...

    implementation "com.google.firebase:firebase-core:16.0.1"
    implementation "com.google.firebase:firebase-messaging:17.3.0"

    implementation "com.google.android.gms:play-services-plus:15.0.1"
    implementation "com.google.android.gms:play-services-auth:15.0.1"
    implementation "com.google.android.gms:play-services-location:15.0.1"
    implementation "com.google.android.gms:play-services-maps:15.0.1"
    implementation "com.google.android.gms:play-services-places:15.0.1"
    implementation "com.google.android.gms:play-services-wallet:15.0.1"

    ...

    implementation 'com.onesignal:OneSignal:3.9.1'

    ...
}

apply plugin: 'com.google.gms.google-services'

Now, syncing with this will cause errors:

Failed to resolve: com.google.firebase:firebase-core:17.3.0
...

Failed to resolve: com.google.android.gms:play-services-plus:17.3.0
...

Failed to resolve: com.google.android.gms:play-services-auth:17.3.0
...

For some reason adding OneSignal causes Google Play Services to be bumped up to to my firebase-messaging version ( 17.3.0 )

Is there any way to fix this? Thanks.



from OneSignal causing Google Play Services version to change

No comments:

Post a Comment