Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated Android Support Library #455

Closed
dmitryshelomanov opened this issue Apr 5, 2018 · 5 comments
Closed

Outdated Android Support Library #455

dmitryshelomanov opened this issue Apr 5, 2018 · 5 comments

Comments

@dmitryshelomanov
Copy link

What is the problem ?

device - Nexus 5X (8.0.0)
dradle - compile "com.android.support:appcompat-v7:23.0.1"
targetSdkVersion - 26
react-native-onesignal - 3.1.4

@jkasten2
Copy link
Member

jkasten2 commented Apr 5, 2018

@userbq201 If you set targetSdkVersion 26 your com.android.support must be 26 as well. Also your compileSdkVersion must be at or newer than targetSdkVersion.

This is a better way to look at it.

minSdkVersion <= targetSdkVersion <= compileSdkVersion
com.android.support = targetSdkVersion

There is a bigger issue however with react-native, from what I have seen targetSdkVersion 26 isn't working
facebook/react-native#18095
It is recommend to keep using targetSdkVersion 22 until react-native updates this to be safe

@dmitryshelomanov
Copy link
Author

@jkasten2 means if minSdkVersion = 16 then targetSdkVersion may be > 16 and < 26 (suppose 24) and compileSdkVersion = 26. Is obtained com.android.support must be 24 ? Taking into account the admonition. Do you need to reduce the number to 23? What role does the minSdkVersion, targetSdkVersion, compileSdkVersion

@dmitryshelomanov
Copy link
Author

@jkasten2 But why is there an error in the admin panel? Because of incorrect versions?

@jkasten2
Copy link
Member

jkasten2 commented Apr 6, 2018

@userbq201 com.android.support should always be the same version as targetSdkVersion. There cases where it will still work when they don't match but Google recommends that they should always be the same.

The reason why the OneSignal dashboard reports Outdated Android Support Library is that 'com.android.support:VERSION' < targetSdkVersion in your project. This is important due to Notification Channel requirements for all notifications added in Android 8.0 (API Level 26). When you set targetSdkVersion to 26 your saying that your app is fully compatible with Android 8. OneSignal relies on the new NotificationCompat.Builder from com.android.support:26.+ which won't be there if this is older.

Google's docs explains minSdkVersion, targetSdkVersion, and compileSdkVersion in more detail.
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html

We have a Gradle plugin I recommend adding which will adjust all com.android.support versions to compatible ones of all dependencies in your project. This should fix the issue you are seeing.
https://github.com/OneSignal/OneSignal-Gradle-Plugin

@ghost
Copy link

ghost commented Feb 22, 2021

I found this link as solution hope wil help you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants