Onesignal-android-sdk: Android SDK: OneSignal needs play-services-base@[10.2.1, 16.1.99] but found 17.1.0

Created on 10 Jan 2020  路  2Comments  路  Source: OneSignal/OneSignal-Android-SDK

Description:

I upgraded Onesignal SDK version from 3.11.4 to 3.12.4 and got this issue:

ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[10.2.1, 16.1.99]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.onesignal:OneSignal:3.12.4 -> com.google.android.gms:play-servicesbase@[10.2.1, 16.1.99], but play-services-base version was 17.1.0.

Environment

Using com.onesignal:OneSignal:3.12.4 version

Steps to Reproduce Issue:

I have these libraries. Check by adding these:

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.1.0'
implementation 'androidx.navigation:navigation-ui:2.1.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.jakewharton:butterknife:10.2.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.android.gms:play-services-auth:17.0.0'
implementation 'com.shobhitpuri.custombuttons:google-signin:1.0.0'

//OneSignal
implementation 'com.onesignal:OneSignal:3.12.4'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'
implementation 'com.squareup.retrofit2:retrofit:2.7.1'
implementation 'com.squareup.retrofit2:converter-gson:2.7.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'
implementation 'com.wdullaer:materialdatetimepicker:4.2.3'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.android.libraries.places:places:2.1.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.alespero:expandable-cardview:0.8'
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.android.play:core:1.6.4'
implementation 'com.google.firebase:firebase-firestore:21.3.1'

Anything else:

Logs:

ERROR: In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[10.2.
1, 16.1.99]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.onesignal:OneSignal:3.12.4 -> com.google.android.gms:play-services-base@[10.2.1, 16.1.99], but p
lay-services-base version was 17.1.0.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the art
ifact with the issue.
-- Project 'app' depends onto com.google.android.libraries.places:[email protected]
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.firebase:firebase-auth-interop@{strictly 19.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-auth@{strictly 19.2.0}
-- Project 'app' depends onto com.google.android.gms:play-services-auth-api-phone@{strictly 17.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-firestore@{strictly 21.3.1}
-- Project 'app' depends onto com.google.firebase:firebase-storage@{strictly 19.1.0}
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.android.gms:play-services-measurement-api@{strictly 17.2.1}
-- Project 'app' depends onto com.google.android.gms:play-services-clearcut@{strictly 17.0.0}
-- Project 'app' depends onto com.google.android.gms:play-services-auth-base@{strictly 17.0.0}
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.android.libraries.places:places@{strictly 2.1.0}
-- Project 'app' depends onto com.onesignal:OneSignal@{strictly 3.12.4}
-- Project 'app' depends onto com.google.android.gms:[email protected]
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.firebase:[email protected]
-- Project 'app' depends onto com.google.android.gms:play-services-maps@{strictly 17.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-iid-interop@{strictly 17.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-messaging@{strictly 20.1.0}
-- Project 'app' depends onto com.google.android.gms:play-services-phenotype@{strictly 17.0.0}
-- Project 'app' depends onto com.onesignal:[email protected]
-- Project 'app' depends onto com.google.android.gms:play-services-location@{strictly 17.0.0}
-- Project 'app' depends onto com.google.android.gms:play-services-base@{strictly 17.1.0}
-- Project 'app' depends onto com.google.android.gms:play-services-auth@{strictly 17.0.0}
-- Project 'app' depends onto com.google.firebase:firebase-iid@{strictly 20.0.2}
-- Project 'app' depends onto com.google.firebase:firebase-analytics@{strictly 17.2.1}

For extended debugging info execute Gradle from the command line with ./gradlew --info :app:assembleDebug to see the dep
endency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://
github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your b
uild.gradle file.

Most helpful comment

@sdzshn3 Please double check you have correctly add the onesignal-gradle-plugin to the top of your app/build.gradle per step 1.1 as this will resolve the out of range dependencies.
https://documentation.onesignal.com/docs/android-sdk-setup#section-1-adding-one-signal-dependencies

Also please ensure you have Jetifier enabled per the instructions here as OneSignal has not migrated to AndroidX yet.
https://documentation.onesignal.com/docs/android-sdk-setup#section-android-x-migration

All 2 comments

@sdzshn3 Please double check you have correctly add the onesignal-gradle-plugin to the top of your app/build.gradle per step 1.1 as this will resolve the out of range dependencies.
https://documentation.onesignal.com/docs/android-sdk-setup#section-1-adding-one-signal-dependencies

Also please ensure you have Jetifier enabled per the instructions here as OneSignal has not migrated to AndroidX yet.
https://documentation.onesignal.com/docs/android-sdk-setup#section-android-x-migration

I have this issue if I upgrade Onesignal SDK version from 3.6.5 to 3.15.2 and got this issue:

Was this page helpful?
0 / 5 - 0 ratings