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

Android Target API Level 26 required in August 2018 #17287

Closed
se-bastiaan opened this issue Dec 20, 2017 · 17 comments
Closed

Android Target API Level 26 required in August 2018 #17287

se-bastiaan opened this issue Dec 20, 2017 · 17 comments
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@se-bastiaan
Copy link
Contributor

se-bastiaan commented Dec 20, 2017

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.

@e2o
Copy link

e2o commented Jan 4, 2018

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.

@react-native-bot
Copy link
Collaborator

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 ContributeWhat to Expect from Maintainers

@react-native-bot react-native-bot added Ran Commands One of our bots successfully processed a command. Stale There has been a lack of activity on this issue and it may be closed soon. and removed Android labels Feb 24, 2018
@stale stale bot removed Stale There has been a lack of activity on this issue and it may be closed soon. labels Feb 24, 2018
@se-bastiaan
Copy link
Contributor Author

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

@joshfriend
Copy link

probably best to copy paste :/

@kelset
Copy link
Contributor

kelset commented Feb 26, 2018

@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 ;)

@mkonicek
Copy link
Contributor

mkonicek commented Mar 1, 2018

@mkonicek
Copy link
Contributor

mkonicek commented Mar 1, 2018

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.

@mkonicek
Copy link
Contributor

mkonicek commented Mar 1, 2018

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.

@mkonicek
Copy link
Contributor

mkonicek commented Mar 1, 2018

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

React Native's build.gradle has targetSdkVersion version set to 22:

targetSdkVersion 22

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.

@se-bastiaan
Copy link
Contributor Author

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.

@joshfriend
Copy link

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.

@MacKentoch
Copy link
Contributor

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?

@se-bastiaan
Copy link
Contributor Author

se-bastiaan commented Apr 9, 2018

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

@MacKentoch
Copy link
Contributor

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...).

samuel-h-r-nunes added a commit to team-r3/r3 that referenced this issue May 17, 2018
* Updated packages:
  * react: ^16.3.2 (was ^16.3.0-alpha.1)
  * react-native: ^0.54.4 (was ^0.54.4)
  * native-base: "^2.4.4 (was ^2.4.2)
  * redux: ^4.0.0 (was ^3.7.2)
  * react-test-renderer: ^16.3.2 (was 16.3.0-alpha.3)
  * NOTE: I read the update notes and these should be safe changes,
    including "redux", which got a major version update.

* Gradle-related changes:
  * Changed the way how the SDK is defined in the Gradle configuration:
    Now this is configured globally in `/android/build.gradle`, which
    gets rid of the version warnings.
  * Updated Gradle to version 4.4 (was 4.1).
  * Updated the Gradle plugin to version 3.1 (was 3.0.1).

INSTALLATION STEPS:
===================
rm package-lock.json
rm node_modules
npm install --no-optional  // (NOTE: "--no-optional" needed on Windows)

TROUBLESHOOTING:
================
* If there are any errors like "could not delete folder x", remove those
  folders manually, e.g.:
    rm C:\r3\android\app\build\intermediates\incremental\processDebugResources
    rm C:\r3\android\app\build\generated\source\r\debug\org\webkit

* If there are errors like "unable to create folder x", try again. It
  should work on the second time.

READ
====
* Main motivation:
  * We should have an SDK version which is at least v26, since that will
    be the minimum to be accepted in the Play store after August 2018:
      facebook/react-native#17287
      facebook/react-native#19297
  * Regarding Gradle, the latest versions are required to build for the
    lastest SDKs, but will also increase compilation time a lot:
      facebook/react-native#15448

* React Native Maps installation and Gradle upgrade instructions:
    https://itnext.io/install-react-native-maps-with-gradle-3-on-android-44f91a70a395

* Migration instructions for the Android Gradle Plugin v3.0.0:
    https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration

* List of versions of the Android Gradle Plugin and upgrade steps:
    https://developer.android.com/studio/releases/gradle-plugin
@agrass
Copy link

agrass commented May 28, 2018

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

@pstanton
Copy link

pstanton commented Jun 5, 2018

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

@kelset
Copy link
Contributor

kelset commented Jun 13, 2018

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

@facebook facebook locked as spam and limited conversation to collaborators Jun 13, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants