React-native-onesignal: Outdated Android Support Library

Created on 5 Apr 2018  路  5Comments  路  Source: OneSignal/react-native-onesignal

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

All 5 comments

@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
https://github.com/facebook/react-native/issues/18095
It is recommend to keep using targetSdkVersion 22 until react-native updates this to be safe

@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

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

@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

I found this link as solution hope wil help you

Was this page helpful?
0 / 5 - 0 ratings