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-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
μ£Όμ
λ¬Έμ λ₯Ό ν΄κ²°νκΈ° μν΄ μ°Έκ³ ν κΉνλΈ μ΄μ νμ΄μ§μ λ΄μ©μλ iOS νλ‘μ νΈμμ pod install
λͺ
λ ΉμΌλ‘ μ€μΉνλ κ²μ μ§μν΄μΌ νλ€κ³ μ΄μΌκΈ°ν©λλ€.
μ°¨ν λ€μ νμΈν΄λ΄μΌκ² μ΅λλ€.