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 #2 #18095

Closed
se-bastiaan opened this issue Feb 26, 2018 · 11 comments
Closed

Android Target API Level 26 required in August 2018 #2 #18095

se-bastiaan opened this issue Feb 26, 2018 · 11 comments
Assignees
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.

Comments

@se-bastiaan
Copy link
Contributor

Here we go again, since #17287 was closed.

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.

@hramos hramos self-assigned this Feb 26, 2018
@sanjib-dev
Copy link

really looking forward for answer/infos as I already started to shift my mobile app into react-native.

@trietbui85
Copy link

I see there is a PR https://github.com/facebook/react-native/pull/17741 to update Android targetSdk but seems no one to review it.

rayronvictor added a commit to rayronvictor/nodejs-mobile-react-native that referenced this issue Apr 24, 2018
Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project.
Default `compileSdkVersion` and `targetSdkVersion` to the latest versions.

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
And the React Native team is already working on this:
facebook/react-native#17741
facebook/react-native#18095
rayronvictor added a commit to rayronvictor/react-native-config that referenced this issue Apr 24, 2018
Instead of assuming the compileSdkVersion, targetSdkVersion, etc, read it from the root project.
Default compileSdkVersion and targetSdkVersion to the latest versions.

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
And the React Native team is already working on this:
facebook/react-native#17741
facebook/react-native#18095
rayronvictor added a commit to rayronvictor/react-native-fetch-blob that referenced this issue Apr 24, 2018
Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project.
Default `compileSdkVersion` and `targetSdkVersion` to the latest versions.

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
And the React Native team is already working on this:
facebook/react-native#17741
facebook/react-native#18095
rayronvictor added a commit to rayronvictor/react-native-i18n that referenced this issue Apr 24, 2018
Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project.
Default `compileSdkVersion` and `targetSdkVersion` to the latest versions.

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
And the React Native team is already working on this:
facebook/react-native#17741
facebook/react-native#18095
rayronvictor added a commit to rayronvictor/react-native-vector-icons that referenced this issue Apr 24, 2018
Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project.
Default `compileSdkVersion` and `targetSdkVersion` to the latest versions.

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
And the React Native team is already working on this:
facebook/react-native#17741
facebook/react-native#18095
rayronvictor added a commit to rayronvictor/react-native-video that referenced this issue Apr 24, 2018
Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project.
Default `compileSdkVersion` and `targetSdkVersion` to the latest versions.

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
And the React Native team is already working on this:
facebook/react-native#17741
facebook/react-native#18095
rayronvictor added a commit to rayronvictor/react-native-fast-image that referenced this issue Apr 24, 2018
Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project.
Default `compileSdkVersion` and `targetSdkVersion` to the latest versions.

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
And the React Native team is already working on this:
facebook/react-native#17741
facebook/react-native#18095
@pstanton
Copy link

If you're moving past SDK 23; You will need to add permission requests ala https://facebook.github.io/react-native/docs/permissionsandroid.html since the permission architecture changed.

besides that, seems to be working

@joshfriend
Copy link

you'll need to add android:usesCleartextTraffic="true" to your AndroidManifest.xml file.

This is only necessary for debug/development builds, please don't do this for release builds. Use manifest placeholders to set this appropriately for each build type.

@sebirdman
Copy link
Contributor

@joshfriend thanks for the tip about automating that with placeholders. updated my comment above to drive people in the right direction.

@techrah
Copy link

techrah commented Jun 18, 2018

Does anyone know how NPM modules that have native Android code configured to build with target SDK versions lower than 26 will fare? I have several modules in my project ranging from 22 to 27. How does this affect the main project?

@se-bastiaan
Copy link
Contributor Author

Expect the libraries to cause problems if they use code that is restricted in newer API levels. The target level basically says 'tested on this API level'. So if the code targets 22 don't expect it to work flawlessly on higher API levels and test before starting extensive usage.

Also, if you have a library that targets 27 then your own target SDK should ideally also be 27. If you're using version 3+ of the Gradle plugin it should warn you about that. Since a lower priority attribute value is higher than the value in your project. See manifest merging heuristics in the Android docs.

That said, I have apps (non-RN) that target API 27 and are using libraries that target API 25. So it can definitely work fine.

macdoum1 pushed a commit to macdoum1/react-native that referenced this issue Jun 28, 2018
Summary:
Starting August 2018, Google Play will require targetSdkVersion 26 for new applications, and November 2018 for application updates.

This PR will use Android build tools 26.0.3 and compilerSdk 26, then support library version 26.0.2 to make targeting 26 easier in the future.

I think this PR will help to people compile and test their applications, thus make transition easier (smoother). Also we'll have opportunity and time to migrate code to target 26.

facebook#18095

React Native on android must work as usual

Closes facebook#19257

Differential Revision: D8010354

Pulled By: mdvacca

fbshipit-source-id: 63ba03585e918b38c2a2adb5d2f2e85d7ce46fae
@Antoine-Mace
Copy link

According to the changelog for the coming RN version 0.56, compiling using Android SDK 26 will be included.

Android projects are now compiled using the Android 26 SDK. The target API level is left unchanged in this release. Starting August 2018, new apps submitted to the Play Store will need to target API 26 as a minimum. You can now opt your project in to use API 26 (or newer) as the target.

https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#056

@hramos hramos added the Resolution: Fixed A PR that fixes this issue has been merged. label Jun 29, 2018
@hramos
Copy link
Contributor

hramos commented Jun 29, 2018

Marking as fixed, but please let us know if there's anything else needed in 0.56 that we might be missing.

@hramos hramos closed this as completed Jun 29, 2018
oblador pushed a commit to oblador/react-native-vector-icons that referenced this issue Jul 20, 2018
* Using SDK Version variables from root project

Instead of assuming the `compileSdkVersion`, `targetSdkVersion`, etc, read it from the root project.
Default `compileSdkVersion` and `targetSdkVersion` to the latest versions.

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
And the React Native team is already working on this:
facebook/react-native#17741
facebook/react-native#18095

* Renaming variables for consistency

* Rename variables and use *Version for all settings
yeomann added a commit to yeomann/react-native-dev-menu that referenced this issue Jul 24, 2018
Instead of assuming the `compileSdkVersion `, `targetSdkVersion`, etc, we can make it dynamic by reading it from the root project.


Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

Therefore I wrote target values of 26 instead of 23

And the React Native team is already working on this:
facebook/react-native#18095
facebook/react-native#17741
yeomann added a commit to yeomann/react-native-fast-image that referenced this issue Jul 24, 2018
just added a function which does acts like a ternary with fallback option. Hence, less cluttered "def" variables  
additionally, changes the SDK values from 23 to 26 as per new changes from react-native and Android

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

And the React Native team is already working on this:
facebook/react-native#18095
facebook/react-native#17741
yeomann added a commit to yeomann/react-native-svg that referenced this issue Jul 24, 2018
Instead of assuming the `compileSdkVersion `, `targetSdkVersion`, etc, we can make it dynamic by reading it from the root project.


Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

Therefore I wrote target values of 26 instead of 23

And the React Native team is already working on this:
facebook/react-native#18095
facebook/react-native#17741
yeomann added a commit to yeomann/rn-fetch-blob that referenced this issue Jul 24, 2018
just added a function which acts like a ternary with fallback option. Hence, less cluttered "def" variables  
additionally, changed the SDK values from 23 to 26 as per new changes from react-native and Android

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

And the React Native team is already working on this:
facebook/react-native#18095
facebook/react-native#17741

PS: I am aware of this PR joltup#128 but first its still targeting old SDK values i.e 23 as fallback and secondly I am not sure of the use of `project` to get the value instead of proper way i.e `rootProject.ext` to get the property value.
yeomann added a commit to yeomann/react-native-maps that referenced this issue Jul 26, 2018
just a little improved version rather then many explicit def for each value. hence, less cluttering. also made the react-native package to get the dynamic versions as well

Android Target API Level 26 will be required in August 2018.
https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

I was going to write 26 but Since we are already using latest Gradle, Therefore I wrote target values of 27 instead of 25.

And the React Native team is already working on this:
facebook/react-native#18095
facebook/react-native#17741
rozele pushed a commit to microsoft/react-native-windows that referenced this issue Aug 17, 2018
Summary:
Starting August 2018, Google Play will require targetSdkVersion 26 for new applications, and November 2018 for application updates.

This PR will use Android build tools 26.0.3 and compilerSdk 26, then support library version 26.0.2 to make targeting 26 easier in the future.

I think this PR will help to people compile and test their applications, thus make transition easier (smoother). Also we'll have opportunity and time to migrate code to target 26.

facebook/react-native#18095

React Native on android must work as usual

Closes facebook/react-native#19257

Differential Revision: D8010354

Pulled By: mdvacca

fbshipit-source-id: 63ba03585e918b38c2a2adb5d2f2e85d7ce46fae
@jonatassena
Copy link

That worked perfectly to me:

android/app/build.gradle:

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"

defaultConfig {
    applicationId "com.rmcinspecoes"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    ndk {
        abiFilters "armeabi-v7a", "x86"
    }        
}

android/build.gradle:

buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
}

@facebook facebook locked as resolved and limited conversation to collaborators Sep 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Ran Commands One of our bots successfully processed a command. Resolution: Fixed A PR that fixes this issue has been merged. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests