- Download Node.js from: https://nodejs.org/en/
- On Windows, set the execution policy from PS as an Administrator and run:
Set-ExecutionPolicy -ExecutionPolicy AllSigned -Scope LocalMachine- For VSCode:
Ctrl + Pand writeext install npm script runnerotherwise it won't be able to use npm in its integrated terminal - Install expo globally
npm install -g react-native-cli
sudo apt update && sudo apt install -y ninja-build default-jre default-jdkCreate a local.properties under the android folder
Windows:
sdk.dir = C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk
# Optional
ndk.dir = C:\\Users\\USERNAME\\AppData\\Local\\Android\\sdk\\ndk\\<NDK_VERSION>Linux:
sdk.dir = ~/Android/sdk/Sdk/
# Optional
ndk.dir = ~/Android/sdk/Sdk/ndk/<NDK_VERSION>npm run android
# or
npm run webset -o allexport; source .env; set +o allexport
cd android
./gradlew bundleRelease
# or
npx react-native build-android --mode=releaseThe generated aab can be found in android/app/build/outputs/bundle/release/app-release.aab.
This can also double checked with react-native`'s feature:
npx react-native run-android --variant=release