Skip to content

Commit a1171f7

Browse files
tido64facebook-github-bot
authored andcommitted
fix(android): fix ndkVersion is unset when building from source (#43131)
Summary: `ndkVersion` is unset when building from source using this guide: https://reactnative.dev/contributing/how-to-build-from-source ## Changelog: [ANDROID] [FIXED] - Fix `ndkVersion` is unset when building from source Pull Request resolved: #43131 Test Plan: ``` git clone https://github.com/microsoft/react-native-test-app.git cd react-native-test-app npm run set-react-version nightly yarn # Manually apply the patch in node_modules/react-native/ReactAndroid/build.gradle.kts # Enable building from source sed -i '' 's/#react.buildFromSource/react.buildFromSource/' example/android/gradle.properties # Build cd example/android ./gradlew assembleDebug ``` Reviewed By: christophpurrer Differential Revision: D54006425 Pulled By: cortinico fbshipit-source-id: 9ede64bc14af4cf609b7a4c12c5a1082bbc31f09
1 parent f3e132b commit a1171f7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/react-native/ReactAndroid/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,8 @@ android {
470470
}
471471
if (rootProject.hasProperty("ndkVersion") && rootProject.properties["ndkVersion"] != null) {
472472
ndkVersion = rootProject.properties["ndkVersion"].toString()
473+
} else {
474+
ndkVersion = libs.versions.ndkVersion.get()
473475
}
474476

475477
compileOptions {

0 commit comments

Comments
 (0)