Skip to content

Commit

Permalink
fix(android): fix ndkVersion is unset when building from source (#4…
Browse files Browse the repository at this point in the history
…3131)

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
  • Loading branch information
tido64 authored and facebook-github-bot committed Feb 21, 2024
1 parent f3e132b commit a1171f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-native/ReactAndroid/build.gradle.kts
Expand Up @@ -470,6 +470,8 @@ android {
}
if (rootProject.hasProperty("ndkVersion") && rootProject.properties["ndkVersion"] != null) {
ndkVersion = rootProject.properties["ndkVersion"].toString()
} else {
ndkVersion = libs.versions.ndkVersion.get()
}

compileOptions {
Expand Down

0 comments on commit a1171f7

Please sign in to comment.