React Native Getting Started νŽ˜μ΄μ§€μ˜ λ‚΄μš©μ„ λ”°λΌν•˜λ©΄μ„œ λ°œμƒν•œ λ¬Έμ œλ“€μž…λ‹ˆλ‹€.

기본적인 μ„€μΉ˜ 및 ꡬ성은 νŽ˜μ΄μ§€λ₯Ό 보며 μ§„ν–‰ν–ˆμŠ΅λ‹ˆλ‹€.

μ €μ˜ ν™˜κ²½μ€ 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