React-native: Android Target API Level 26 required in August 2018

Created on 20 Dec 2017  Â·  17Comments  Â·  Source: facebook/react-native

Now I know that this isn't a real bug report. It is not even a real feature request. But I needed to post this somewhere and none of the other channels seemed appropriate.

On 19 December Google announced the following:

In the second half of 2018, Play will require that new apps and app updates target a recent Android API level. This will be required for new apps in August 2018, and for updates to existing apps in November 2018. This is to ensure apps are built on the latest APIs optimized for security and performance.

source: https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

More specifically:

  • August 2018: New apps required to target API level 26 (Android 8.0) or higher.
  • November 2018: Updates to existing apps required to target API level 26 or higher.
  • 2019 onwards: Each year the targetSdkVersion requirement will advance. Within one year following each Android dessert release, new apps and app updates will need to target the corresponding API level or higher.

I believe this is of great importance for React Native since the current default targetSdkVersion seems to be 22. And thus I can only deduce that React Native is not ready for a higher Android API Level. Yes, people have been using React Native using higher API levels but it seems that it's not stable. Time to bump the API Level? Or make sure that everything will work on 26?

TL;DR: You will not be able to release a _stable_ React Native application through the Play Store if you use the default targetSdkVersion starting August 2018. Be ready.

Ran Commands Locked

Most helpful comment

Any update on this?

As with changing the targetSdkVersion to 26, the compileSdkVersion will have to be at least 26 as well. (this is currently still on 23).

Our team wants to start using 26 (as we need functionality from that API level), but we want to be sure that it's stable and officialy supported by React Native.

All 17 comments

Any update on this?

As with changing the targetSdkVersion to 26, the compileSdkVersion will have to be at least 26 as well. (this is currently still on 23).

Our team wants to start using 26 (as we need functionality from that API level), but we want to be sure that it's stable and officialy supported by React Native.

Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version?

I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer.

How to Contribute • What to Expect from Maintainers

I guess this happened since I didn't use the template. Could anyone just reopen it? Or should I copy-paste my issue text?

probably best to copy paste :/

@se-bastiaan don't take it personal, the team was simply testing a stricter set of rules for the bot - but they already realised it was a bit too strict. The new one won't get closed ;)

@se-bastiaan, @e2o It's being discussed in the fb group: https://www.facebook.com/groups/react.native.community/permalink/1167833770018866/

I assume the bot is configured to close issues without the template because the team wants discussions to happen in other channels than GitHub issues, and questions to be posted on Stack Overflow.

I believe this is of great importance for React Native since the current default targetSdkVersion seems to be 22. And thus I can only deduce that React Native is not ready for a higher Android API Level.

I don't think this is the case. There are apps with targetSdkVersion > 22 that use RN.

Posting here what I posted in the fb group, for more visibility:

React Native's build.gradle has targetSdkVersion version set to 22:
https://github.com/facebook/react-native/blob/74e54cbcc408a8bbdd70f47cc8728d30cdc0d299/ReactAndroid/build.gradle#L239

You can still set targetSdkVersion for your app to higher than 22 (I'm using 27).

I just changed the targetSdkVersion of my brand-new RN Android app to 27 (created with 'react-native init') and double checked that the version I declared in my app's AndroidManifest.xml has precedence:

$ aapt list -a ./android/app/build/outputs/apk/app-debug.apk | grep SdkVersion

      A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
      A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1b

So the binary's minSdkVersion is 16 and targetSdkVersion is 27 as I declared. The app runs fine.

I don't remember the reason the RN targetSdkVersion is still set to 22. If you have more context, please on the post. I think there were some pull requests that tried to increase the targetSdkVersion but couldn't find them after a few Google searches.

Well, that's the complete issue. Why is it set to 22 if target API 27 would be stable? I'd say that you'd want to use the latest Android build tools by default and they're currently outdated.

That you _can_ change the target doesn't mean that it is supported at all. You're assuming that it is just because someone else changed some number. If you want to build a production app based on that assumption then that's fine, but I'd rather not.

There are _many_ new behaviors and significant changes that you opt your app into when you move from 22 to 27. Unless you completely understand what the consequences are of doing this, you should leave it as is until RN is updated appropriately.

In August 2018 all new android applications published to the playStore will have to be with target API level 26 minimum.

This is a way for Google to force better quality apps (and more secured, from API 22 to 26 there are so many changes...) so a this is good thing.

When will react-native init set android to target SDK 26?

You're perfectly summarising the issue description. You should check #18095 though, as this issue was closed. No need to ask for an ETA.

Before commenting, I already manually set targetSdkVersion to 26 in my latests apps.

No noticeable issue until now (even when using tons of firebase and usual dependencies).

I just hope it won't hurt stability or anything else.

I stay clearly confident in React-Native (I mean contributors, Facebook people behind etc...).

Any update with this? Anyone using API 26 in production??

You will need to add permission requests ala https://facebook.github.io/react-native/docs/permissionsandroid.html since the permission architecture changed around 23.

besides that, seems to be working

Locking down this issue in order to avoid people writing comments here instead of #18095

Was this page helpful?
0 / 5 - 0 ratings