Skip to content

Commit 38100f7

Browse files
authored
fix(android): bump NDK to r23c (#1168)
1 parent afa76ec commit 38100f7

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

android/dependencies.gradle

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,23 @@ ext {
99
minSdkVersion = 23
1010
targetSdkVersion = 29
1111

12+
def reactNativeVersion = getPackageVersionNumber("react-native", rootDir)
13+
def useAndroidPlugin_7_2 = reactNativeVersion > 0 && reactNativeVersion < 7100
14+
1215
// We need only set `ndkVersion` when building react-native from source.
1316
if (rootProject.hasProperty("ANDROID_NDK_VERSION")) {
1417
ndkVersion = rootProject.properties["ANDROID_NDK_VERSION"]
15-
} else if (System.properties["os.arch"] == "aarch64") {
16-
// Android NDK added support for Apple M1 in r24:
17-
// https://github.com/android/ndk/wiki/Changelog-r24
18-
ndkVersion = "24.0.8215888"
18+
} else if (System.properties["os.arch"] == "aarch64" && useAndroidPlugin_7_2) {
19+
// NDK r23c has been patched to support Apple M1 and is default in AGP
20+
// 7.3.0. Prior to 0.71, we still need to set `ndkVersion` because we'll
21+
// be using AGP 7.2.2 (see `androidPluginVersion` below).
22+
// Note that even though newer 23.x versions exist, we'll stick to AGP's
23+
// default. See also
24+
// https://developer.android.com/studio/releases/gradle-plugin#compatibility-7-3-0
25+
ndkVersion = "23.1.7779620"
1926
}
2027

21-
androidPluginVersion = getPackageVersionNumber("react-native", rootDir) < 7100
28+
androidPluginVersion = useAndroidPlugin_7_2
2229
? "7.2.2"
2330
: "7.3.0"
2431
kotlinVersion = rootProject.hasProperty("KOTLIN_VERSION")

0 commit comments

Comments
 (0)