File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 9
9
minSdkVersion = 23
10
10
targetSdkVersion = 29
11
11
12
+ def reactNativeVersion = getPackageVersionNumber(" react-native" , rootDir)
13
+ def useAndroidPlugin_7_2 = reactNativeVersion > 0 && reactNativeVersion < 7100
14
+
12
15
// We need only set `ndkVersion` when building react-native from source.
13
16
if (rootProject. hasProperty(" ANDROID_NDK_VERSION" )) {
14
17
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"
19
26
}
20
27
21
- androidPluginVersion = getPackageVersionNumber( " react-native " , rootDir) < 7100
28
+ androidPluginVersion = useAndroidPlugin_7_2
22
29
? " 7.2.2"
23
30
: " 7.3.0"
24
31
kotlinVersion = rootProject. hasProperty(" KOTLIN_VERSION" )
You can’t perform that action at this time.
0 commit comments