React Native Getting Started νμ΄μ§μ λ΄μ©μ λ°λΌνλ©΄μ λ°μν λ¬Έμ λ€μ λλ€.
- μμνκΈ° μ λ§? #1
- μμνκΈ° μ λ§? #2 π
- μμνκΈ° μ λ§? #3
κΈ°λ³Έμ μΈ μ€μΉ λ° κ΅¬μ±μ νμ΄μ§λ₯Ό 보며 μ§ννμ΅λλ€.
μ μ νκ²½μ macOS 10.14.5 μ λλ€.
Expo λ μ¬μ©νμ§ μκ³ , React Native CLI λ‘ νλ‘μ νΈλ₯Ό μ€μΊν΄λ©νμ΅λλ€.
Node, XCode, Android Studio κ° μ€μΉλμ΄ μμ΅λλ€.
- Node v11.7.0
- npm v6.5.0
- Xcode v10.2.1 (10E1001), XCode command line tools installed
- Android Studio v3.4, Android SDK installed
Xamarin μΌλ‘ μμ±λ λͺ¨λ°μΌ μμ©νλ‘κ·Έλ¨μ React Native λ‘ μ¬μμ±νκΈ° μν΄ νλ‘μ νΈλ₯Ό λ§λ€μμ΅λλ€.
$ react-native init ScoreBoard
보ν΅μ μ€μΊν΄λ©λ νλ‘μ νΈκ° λ°λ‘ μ€νμ΄ κ°λ₯νλ, λ°λ‘ μ€νν΄ λ΄€μ΅λλ€.
$ react-native run-android
info Starting JS server...
info Installing the app...
> Configure project :app
File /Users/bbon/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 28.0.3 in /Users/bbon/Library/Developer/Xamarin/android-sdk-macosx/licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: /Users/bbon/Library/Developer/Xamarin/android-sdk-macosx
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 10s
error Failed to install the app. Please accept all necessary SDK licenses using SDK Manager: "$ANDROID_HOME/tools/bin/sdkmanager --licenses". Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
Using Android SDK: /Users/bbon/Library/Developer/Xamarin/android-sdk-macosx
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 10s
at checkExecSyncError (child_process.js:625:11)
at execFileSync (child_process.js:643:13)
at runOnAllDevices (/Users/bbon/Repos/scoreboard-rn/ScoreBoard/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:75:39)
at buildAndRun (/Users/bbon/Repos/scoreboard-rn/ScoreBoard/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:137:41)
at then.result (/Users/bbon/Repos/scoreboard-rn/ScoreBoard/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:103:12)
at processTicksAndRejections (internal/process/next_tick.js:81:5)
Android Studio λ₯Ό μ€μΉνκ³ μ€ννμ§ μμ μλλ‘μ΄λ SDK λΌμ΄μ μ€ μ¬μ©μ λν λμλ₯Ό νμ§ μμ λ°μν λ¬Έμ λ‘ λ³΄μ¬μ§λλ€.
μλ λͺ λ ΉμΌλ‘ μλλ‘μ΄λ SDK λΌμ΄μ μ€ μ¬μ© λμλ₯Ό μ§νν μ μμ΅λλ€.
$ $ANDROID_HOME/tools/bin/sdkmanager --licenses
μ΄ν μ μμ μΌλ‘ μ€νμ΄ κ°λ₯ν©λλ€.
$ react-native run-android