# Setting
- [cmd] react-native-cli
# clean
yarn global remove react-native
yarn global remove react-native-cli
npm uninstall -g react-native
npm uninstall -g react-native-cli
# install
yarn global list
npm -g list
npm install -g react-native
npm install -g react-native-cli
npx react-native --version
- [EnvironmentVariable] ANDROID_HOME
%USERPROFILE%\AppData\Local\Android\Sdk\
# C:\Users\{User}\AppData\Local\Android\Sdk\
- [EnvironmentVariable] Path
%ANDROID_HOME%\platform-tools
%ANDROID_HOME%\emulator
%ANDROID_HOME%\tools
%ANDROID_HOME%\tools\bin
%USERPROFILE%\AppData\Local\Android\Sdk\platform-tools
# C:\Users\{User}\AppData\Local\Android\Sdk\platform-tools
- [cmd]
adb
# Init React-Native
- [cmd] init
# npx react-native init reactnative
npx react-native init reactnative --version 0.68.2
- [cmd] Android Start
react-native run-android
npm run android
- [error] Failed to install the following Android SDK packages as some licences have not been accepted. Add to Google licenses on SDK tools(at Android Studio) C:\Users{User}\AppData\Local\Android\Sdk\licenses
# module clean
# package.json
"build": "npm build", "clean": "rm -rf node_modules", "reinstall": "npm run clean && npm install", "rebuild": "npm run clean && npm install && npm run build",
# npm μ¬μΈμ€ν¨
npm ci
# npx npkill
npx npkill
# chocolatey μ€μ
1. PowerShell
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
2. CMD
choco install -y nodejs.install
choco install -y python2
choco install -y jdk8
3. μλλ‘μ΄λ μ€μ
- μλλ‘μ΄λ μ€μΉ
- SDK Manager μ€μ μμ licenses κ΄λ ¨ μΆκ°
- νκ²½λ³μ ANDROID_HOME,Pathμ SDK tools μ€μ
- AVD Manger λλ μλλ‘μ΄λ κΈ°κ³λ‘ μ°κ²°
4. React-Native μ€μ
npm install -g react-native-cli
5. React-Native Init
react-native init Test
react-native run-android
6. Android Build
cd android
gradlew assembleRelease
β - rn-setting - javascript β