Following previous article, console.log, if we run yarn ios
on rnw-github
directory, we’ll got following error:
β rnw-github git:(master) β yarn ios
yarn run v1.12.1
$ react-native run-ios
Scanning folders for symlinks in /Users/haruelrovix/Projects/rnw-github/node_modules (49ms)
Found Xcode project creaternwapp.xcodeproj
xcrun: error: unable to find utility “instruments”, not a developer tool or in PATHCommand failed: xcrun instruments -s
xcrun: error: unable to find utility “instruments”, not a developer tool or in PATHerror Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
To fix that, follow guidance from dev’s God of Answer, Stack Overflow:
In Xcode, select Xcode menu, then Preferences, then Locations tab. Select your Xcode version from the dropdown and exit Xcode.
Wait a minute… There is no Xcode installed, yet. π€£
Tried to install latest Xcode, current macOS (Sierra) doesn’t support it. π There is no other way then. Let’s upgrade it to Mojave!
2 days later…
Mojave β
Xcode β
Run yarn ios
again:
β rnw-github yarn ios
yarn run v1.12.1
$ react-native run-ios
Scanning folders for symlinks in /Users/haruelrovix/Projects/rnw-github/node_modules (67ms)
Found Xcode project creaternwapp.xcodeprojAgreeing to the Xcode/iOS license requires admin privileges, please run βsudo xcodebuild -licenseβ and then retry this command.
Command failed: xcrun instruments -s
Agreeing to the Xcode/iOS license requires admin privileges, please run βsudo xcodebuild -licenseβ and then retry this command.
error Command failed with exit code 1.
It asks for license. Run sudo xcodebuild -license
, input password, read the terms of the software license agreements and type agree
.
After that, run yarn ios
again still gives an error.
Could not parse the simulator list output
Take a step back, go to RN Getting Started.
watchman?
β rnw-github git:(master) β brew list
yarn
LoL. There only exist yarn
πΉ
Install node
via brew:
β rnw-github git:(master) β brew install node
Install watchman
:
β rnw-github git:(master) β brew install watchman
watchman
needs python as its dependency. If you got brew link
error during installation:
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ dir_s_mkdir – /usr/local/lib
Error: Permission denied @ dir_s_mkdir – /usr/local/lib
Follow this post, Brew Link – Error: Permission denied @ dir_s_mkdir, to fix it.
β rnw-github git:(master) β sudo mkdir /usr/local/include
β rnw-github git:(master) β sudo chown -R $(whoami) /usr/local/include
β rnw-github git:(master) β brew link gdbm
Linking /usr/local/Cellar/gdbm/1.18.1… 12 symlinks created
β rnw-github git:(master) β brew link xz
Linking /usr/local/Cellar/xz/5.2.4… 53 symlinks created
β rnw-github git:(master) β brew link pcre
Linking /usr/local/Cellar/pcre/8.42… 133 symlinks created
Tried to install watchman
again, it should be installed successfully.
β rnw-github git:(master) β brew install watchman
Updating Homebrew…
==> Downloading https://homebrew.bintray.com/bottles/watchman-4.9.0_2.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring watchman-4.9.0_2.mojave.bottle.tar.gz
==> launchctl unload -F /Users/haruelrovix/Library/LaunchAgents/com.github.facebook.watchman.plist
πΊ /usr/local/Cellar/watchman/4.9.0_2: 23 files, 2.1MB
Install React Native CLI:
β rnw-github git:(master) β npm install -g react-native-cli
+ react-native-cli@2.0.1
added 41 packages from 15 contributors in 11.197s
Run yarn ios
again:
Installing build/Build/Products/Debug-iphonesimulator/creaternwapp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application’s Info.plist contains a value for CFBundleIdentifier.
Print: Entry, “:CFBundleIdentifier”, Does Not ExistCommand failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/creaternwapp.app/Info.plist
Print: Entry, “:CFBundleIdentifier”, Does Not Exist
π€£ another error!
Seems there’s a RN bug when using Xcode 10. Fix it by following this thread:
β rnw-github git:(master) β curl -L https://git.io/fix-rn-xcode10 | bash
Run yarn ios
, the error persist π
** BUILD FAILED **** BUILD FAILED **
The following build commands failed: Libtool /Users/haruelrovix/Projects/rnw-github/ios/build/Build/Products/Debug-iphonesimulator/libRCTWebSocket.a normal x86_64(1 failure)
Use this command to fix that:
$ cp ios/build/Build/Products/Debug-iphonesimulator/libfishhook.a node_modules/react-native/Libraries/WebSocket
After that, error related to AppCenter:
The following build commands failed:The following build commands failed: CompileC /Users/haruelrovix/Projects/rnw-github/ios/build/Build/Intermediates.noindex/AppCenterReactNative.build/Debug-iphonesimulator/AppCenterReactNative.build/Objects-normal/x86_64/AppCenterReactNative.o /Users/haruelrovix/Projects/rnw-github/node_modules/appcenter/ios/AppCenterReactNative/AppCenterReactNative.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler(1 failure)
@andangrd created a troubleshooting section to get started with AppCenter on iOS:
$ sudo gem install cocoapods –source http://rubygems.org
$ yarn add appcenter appcenter-analytics appcenter-crashes –exact
$ react-native link appcenter
$ react-native link appcenter-analytics
$ react-native link appcenter-crashes
Run yarn ios
now… Finally!
Leave a Comment