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-ios
info Found Xcode project "ScoreBoard.xcodeproj"
info Building (using "xcodebuild -project ScoreBoard.xcodeproj -configuration Debug -scheme ScoreBoard -destination id=83FAF3D3-6BBE-4D55-91BC-EA307C8A7F81 -derivedDataPath build/ScoreBoard")
.................
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening ScoreBoard.xcodeproj. Run CLI with --verbose flag for more details.
User defaults from command line:
    IDEDerivedDataPathOverride = /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard

note: Using new build system
note: Planning build
note: Using build description from disk
PhaseScriptExecution Start\ Packager /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Script-FD10A7F022414F080027D42C.sh (in target: ScoreBoard)
    cd /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios
    /bin/sh -c /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Script-FD10A7F022414F080027D42C.sh

CompileC /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Objects-normal/x86_64/main.o /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/ScoreBoard/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: ScoreBoard)
    cd /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -index-store-path /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Index/DataStore -iquote /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/ScoreBoard-generated-files.hmap -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/ScoreBoard-own-target-headers.hmap -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/ScoreBoard-all-target-headers.hmap -iquote /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/ScoreBoard-project-headers.hmap -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Products/Debug-iphonesimulator/include -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/DerivedSources-normal/x86_64 -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/DerivedSources/x86_64 -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/DerivedSources -F/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Products/Debug-iphonesimulator -MMD -MT dependencies -MF /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Objects-normal/x86_64/main.d --serialize-diagnostics /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Objects-normal/x86_64/main.dia -c /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/ScoreBoard/main.m -o /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Objects-normal/x86_64/main.o
In file included from /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/ScoreBoard/main.m:10:
/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/ScoreBoard/AppDelegate.h:8:9: fatal error:
'React/RCTBridgeDelegate.h' file not found
#import <React/RCTBridgeDelegate.h>

        ^~~~~~~~~~~~~~~~~~~~~~~~~~~

1
 error generated.

CompileC /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Objects-normal/x86_64/AppDelegate.o /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/ScoreBoard/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: ScoreBoard)
    cd /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/ModuleCache.noindex -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wunreachable-code -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -DDEBUG=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.0 -g -Wno-sign-conversion -Winfinite-recursion -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -index-store-path /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Index/DataStore -iquote /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/ScoreBoard-generated-files.hmap -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/ScoreBoard-own-target-headers.hmap -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/ScoreBoard-all-target-headers.hmap -iquote /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/ScoreBoard-project-headers.hmap -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Products/Debug-iphonesimulator/include -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/DerivedSources-normal/x86_64 -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/DerivedSources/x86_64 -I/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/DerivedSources -F/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Products/Debug-iphonesimulator -MMD -MT dependencies -MF /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Objects-normal/x86_64/AppDelegate.d --serialize-diagnostics /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Objects-normal/x86_64/AppDelegate.dia -c /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/ScoreBoard/AppDelegate.m -o /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Objects-normal/x86_64/AppDelegate.o
In file included from /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/ScoreBoard/AppDelegate.m:8:
/Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/ScoreBoard/AppDelegate.h:8:9: fatal error: 'React/RCTBridgeDelegate.h' file not found
#import <React/RCTBridgeDelegate.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.


** BUILD FAILED **


The following build commands failed:
	CompileC /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/build/ScoreBoard/Build/Intermediates.noindex/ScoreBoard.build/Debug-iphonesimulator/ScoreBoard.build/Objects-normal/x86_64/main.o /Users/bbon/Repos/scoreboard-rn/ScoreBoard/ios/ScoreBoard/main.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

μ˜ˆμƒκ³Ό λ‹€λ₯΄κ²Œ λΉŒλ“œκ°€ μ‹€νŒ¨ν•©λ‹ˆλ‹€.

iOS ν”„λ‘œμ νŠΈμ˜ 의쑴 νŒ¨ν‚€μ§€ μ„€μΉ˜κ°€ μ—†μ–΄μ„œ μ‹€νŒ¨ν–ˆλ‹€λŠ” λ‚΄μš©μ„ ν™•μΈν•©λ‹ˆλ‹€.

ν•„μš”ν•œ cocoapods νŒ¨ν‚€μ§€ κ΄€λ¦¬μžκ°€ μ—†μŠ΅λ‹ˆλ‹€.

homebrew 둜 cocoapods μ„€μΉ˜ν•©λ‹ˆλ‹€.

$ brew install cocoapods

iOS ν”„λ‘œμ νŠΈ λ””λ ‰ν„°λ¦¬λ‘œ μ΄λ™ν•΄μ„œ 의쑴 νŒ¨ν‚€μ§€λ₯Ό λ‚΄λ €λ°›μ•„ μ„€μΉ˜ν•©λ‹ˆλ‹€.

$ cd ios
$ pod install

λ‹€μ‹œ μ‹€ν–‰ν•˜λ©΄ μ •μƒμ μœΌλ‘œ μ‹€ν–‰λ©λ‹ˆλ‹€.

$ cd ..
$ react-native run-ios

react native ios 2019 07 12 001
가상μž₯μΉ˜μ—μ„œ μ‹€ν–‰λœ μ•±

주의

문제λ₯Ό ν•΄κ²°ν•˜κΈ° μœ„ν•΄ μ°Έκ³ ν•œ κΉƒν—ˆλΈŒ 이슈 νŽ˜μ΄μ§€μ˜ λ‚΄μš©μ—λŠ” iOS ν”„λ‘œμ νŠΈμ—μ„œ pod install λͺ…λ ΉμœΌλ‘œ μ„€μΉ˜ν•˜λŠ” 것을 지양해야 ν•œλ‹€κ³  μ΄μ•ΌκΈ°ν•©λ‹ˆλ‹€. μ°¨ν›„ λ‹€μ‹œ ν™•μΈν•΄λ΄μ•Όκ² μŠ΅λ‹ˆλ‹€.