Skip to content

Commit

Permalink
Use modern Android libc++ in Yoga and React Native OSS (facebook#39795)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#39795
X-link: facebook/yoga#1412

Android NDK 25 uses a version of libc++ that is more than three years old, missing a lot of basic features of C++ 20. This is rectified in NDK 26 (latest LTS NDK), which brings us up to date with latest Clang (17, released this year), and adds a new policy where future NDK versions will bump libc++ as part of bumping LLVM/Clang.

This requires an a beta AGP version (and corresponding Android Studio Preview). Based on how far we are historically, it wouldn't be a surprise if we see the stable release this month (well before the RN 0.74/Yoga 3.0 cut, even in the worse case).

Changelog:
[Android][Changed] - Use NDK 26

Differential Revision: D49895949

fbshipit-source-id: 36b7777f4fcd6b8f577aa1dc654237ff53bda8bd
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Oct 4, 2023
1 parent c46866c commit 25a6ff1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ version =
group = "com.facebook.react"

val ndkPath by extra(System.getenv("ANDROID_NDK"))
val ndkVersion by extra(System.getenv("ANDROID_NDK_VERSION") ?: "25.1.8937393")
val ndkVersion by extra(System.getenv("ANDROID_NDK_VERSION") ?: "26.0.10792818")
val sonatypeUsername = findProperty("SONATYPE_USERNAME")?.toString()
val sonatypePassword = findProperty("SONATYPE_PASSWORD")?.toString()

Expand Down Expand Up @@ -106,11 +106,11 @@ if (project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoole
"""
********************************************************************************
INFO: You're using Hermes from nightly as you set
react.internal.useHermesNightly=true
in the ./gradle.properties file.
That's fine for local development, but you should not commit this change.
********************************************************************************
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ add_compile_options(
-O2
-Wno-unused-function
-Wno-unneeded-internal-declaration
-Wno-array-parameter # Fixed in 2.2.1 (not yet released)
-std=c11)

add_library(event
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ targetSdk = "34"
compileSdk = "34"
buildTools = "34.0.0"
# Dependencies versions
agp = "8.1.1"
agp = "8.2.0-beta06"
androidx-annotation = "1.6.0"
androidx-appcompat = "1.6.1"
androidx-autofill = "1.1.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native/template/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
minSdkVersion = 23
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "25.1.8937393"
ndkVersion = "26.0.10792818"
kotlinVersion = "1.8.0"
}
repositories {
Expand Down

0 comments on commit 25a6ff1

Please sign in to comment.