Fresh react-native ios app not building? - ios

Below is the details about my environment and logs of the build failure.
Anyone facing similar issue or know steps to overcome this please do point me out to relevant steps or docs.
Xcode: 7.2.1
Node: v5.9.0
npm: 3.7.3
react-native-cli: 0.1.10
react-native: 0.22.2
Running "sudo react-native run-ios" leaves me with the below logs.
LOGS:
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution Run\ Script /Users/abc/Desktop/REACT-NATIVE/demo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/demo.app
No devices are booted.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/done.js:10
throw err;
^
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/demo.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:469:13)
at Object.execFileSync (child_process.js:489:13)
at _runIOS (runIOS.js:83:34)
at runIOS.js:24:5
at tryCallTwo (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (runIOS.js:23:10)
at Object.run (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/react-native/local-cli/cli.js:86:13)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:73:7)

do not run:
sudo react-native run-ios
you should run:
react-native run-ios
your root account does not have Simulator configured properly to run the iOS so you see "No devices are booted" error in your log!

I have similar issue on OS X El Capitan v10.11.4
node --version v6.0.0
npm --v 3.8.8
react-native-cli: 0.2.0
react-native: 0.24.1
watchman --v 4.4.0
xcode 7.3
I have created an issue on react-native github.
I was able to resolve my issue:
For me port 8081 was in use :
lsof -n -i4TCP:8081
node 7601 arun 23u IPv6 0xc6b249599e5f1169 0t0 TCP *:sunproxyadmin (LISTEN)
So I followed the instructions from React Native Troubleshooting and killed the pid
kill -9 7601
and ran the command react-native run-ios again and everything worked as expected (on node 6 as well).

Seems you have a wrong path to the Developer directory.
You can check it by running
$ sudo xcode-select -p
Unless you really know what you do, it should points to /Applications/Xcode.app/Contents/Developer.
If that's wrong, try running this command to fix it:
$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

FWIW I was having the exact same problem. However, I was using an older version of Xcode (on Yosemite). I had done a complete reinstall of NVM, NPM, and react-native-cli. Nothing worked. In doing so, I also followed a guide to ensure that node was uninstalled cleanly before I reinstalled.
What eventually worked was upgrading OSX itself to allow installation of the latest XCode (7.3 at this time). Now it works perfectly. I am able to run react-native run-ios from the root directory of my project without the need for sudo. As for the sudo issue you might try making sure you are owner of Projects folder. That helped me as well.
So yeah.. I upgraded to OSX 10.11.4 and XCode 7.3. Worked for me.
Good luck.

not sure if this is related but i had to make sure i was on ruby-2.0.0-p648
using a newer ruby gave me similar compilation problems.

Related

XCode Build Phase script exit code 1 error React Native

I am working on a React-Native application. I've inherited it, development has been stopped for a while and some of the dependencies are outdated. I do not believe this is part of the problem but worth mentioning. Whatever I do, both on the command line and in XCode, the build fails with the following error:
/bin/sh -c /Users/ME/Library/Developer/Xcode/DerivedData/AppName-cftpundgcnfgkvchyeqvsgfusuhb/Build/Intermediates.noindex/AppName.build/Debug-iphonesimulator/AppName.build/Script-948B6EB41D047ADB00584768.sh
Error loading build config, ignoring
Command /bin/sh failed with exit code 1
What I've done
npm install
In the ios directory, "sudo gem install cocoapods" and "pod install"
react-native run-ios
One way or another, this never works and the error is always the one above
What I've tried
Locking and unlocking the keychain
Deleting the derived data folder, cleaning and re-building
Ticking the "only run for install" checkbox in XCode in the RN bundle section
Using yarn instead of npm
pod deintegrate and install once again
Upgrading react-native
Once more, no luck
I'm fairly new to this and don't fully understand what's going on - or why this is failing. Any ideas as to how to solve it?
Version info
react-native-cli: 2.0.1
react-native: 0.61.5
xcode: Version 12.3 (12C33)
simulator: iphone 11 (ios 14.3)

Lexical or processor issue: boost/config/user.hpp' file not found

When i run my react native app in Xcode, it shows an error "boost/config/user.hpp' file not found" . And also when i run the application using the command "react-native run-ios" ,I got an error in terminal ,
"Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/sample2.app/Info.plist" Print: Entry, ":CFBundleIdentifier", Does Not Exist " .
How can i solve this. I am a bigginer in react native app development.
It's related to this boost package: ./node_modules/react-native/third-party/boost_1_63_0/boost/config
Remove third-party folder from path: /node_modules/react-native/third-party/
Re-run the Xcode project.
Do you have any updates to run on your machine/xcode? I had this issue when I had pending macOS Sierra updates to install.
I installed the updates which caused my mac to restart, I then ran npm install and tried to build again and it succeeded.
Versions:
macOS Sierra: 10.12.6
Xcode: 8.3.3
react: 16.0.0-alpha.12
react-native: 0.47.1
Some packages are not installed properly. Just delete node-modules forder with rm -rf node-modules and run again (npm install or yarn install).

Appcelerator - Xcode EULA has not been accepted. Launch Xcode and accept the license

I am running appcelerator 4.5.0 and xcode 7.2.1 on Mac OS X 10.10.5
Running an iOS app gives me:
[ERROR] : Xcode EULA has not been accepted.
[ERROR] : Launch Xcode and accept the license.
I ran sudo xcodebuild -license per: "Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo." when using GCC
But the error persists.
I then (per: https://wiki.appcelerator.org/display/guides2/Uninstalling+Studio) uninstalled appcelerator by deleting:
/Applications/Aptana Studio 3
/Applications/Titanium Studio
/Application/Appcelerator Studio
and then (per https://archive.appcelerator.com/topic/474/how-do-you-uninstall-titanium-and-appcelerator-studio-completely-and-start-from-scratch):
rm -rf ~/.appcelerator
rm -rf ~/.titanium
sudo npm uninstall -g titanium
sudo npm uninstall -g alloy
sudo npm uninstall -g acs
sudo npm uninstall -g appcelerator
and uninstalled xcode with sudo /Developer/Library/uninstall-devtools --mode=all per: http://osxdaily.com/2012/02/20/uninstall-xcode/
and I deleted Xcode.app from my Applications folder.
After all that I redownloaded xcode via software update, ran sudo xcodebuild -license (typing accept at the end), then installed from the site Appcelerator_Studio.dmg and ran appc setup
But still the error persists.
Any ideas on how to fix?
MORE INFO: After reading https://archive.appcelerator.com/question/155502/using-the-titanium-cli-and-getting-error-you-have-not-agreed-to-the-xcode-license-agreements-please-run-xcodebuild--license I believe I have the same issue (still no resolution though).
Running:
xcodebuild -sdk iphonesimulator is successful but if I run:
appc titanium build -p ios -T simulator -Y iphone I get the same errors as above.
UPDATE based on #andre-m comment (referencing https://apple.stackexchange.com/questions/175069/how-to-accept-xcode-license):
I already mentioned that I have run sudo xcodebuild -license but I also tried:
sudo xcodebuild -license accept which gives no output and then I still give the error on the build;
sudo xcode-select -r no output, error;
sudo xcode-select --install outputs: xcode-select: error: command line tools are already installed, use "Software Update" to install updates but still errors;
sudo softwareupdate -l outputs:No new software available. and then still gives the error;
sudo xcrun cc outputs clang: error: no input files
UPDATE based on #fokke-appcelerator comment (note these results are the same on both a working and non-working machine):
xcodebuild -checkFirstLaunchStatus; echo $?; gives 0
sudo xcodebuild -checkFirstLaunchStatus; echo $?; gives 69
Deleted Xcode.app from Applications (again), reinstalled xcode 7.2.1 -> this time from xcode dmg file How to download Xcode DMG or XIP file? (previously via Software Update), opened Xcode and was not given any EULA dialog.
SOLUTION:
Following #fokke-appcelerator's second I logged the exit code, out, and err of https://github.com/appcelerator/titanium_mobile/blob/master/node_modules/ioslib/lib/xcode.js#L333 (which is located here: /Users/<my_user>/Library/Application Support/Titanium/mobilesdk/osx/5.2.0.GA/node_modules/ioslib/lib) and got: xcodebuild: error: invalid option '-checkFirstLaunchStatus' because that xcode.js script found an older version of Xcode (4.2.6) that was not removed by sudo /Developer/Library/uninstall-devtools --mode=all as it should have.
Removing the old version of Xcode and reinstalling the current version of Xcode and then reinstalling the simulators (Launch Xcode; Select Xcode > Preferences; Select the Downloads icon; Click the Install button next to the desired simulator), and reinstalling Appcelerator ...the problem is now solved.
Just as FYI. I Had same issue and it was because I had downloaded a beta version of xCode but had not opened it (still had current version installed too). Once I opened the beta and went through everything I was able to go back to appc and package app without errors.
We check if the EULA has been accepted here:
https://github.com/appcelerator/titanium_mobile/blob/master/node_modules/ioslib/lib/xcode.js#L332
Which runs:
xcodebuild -checkFirstLaunchStatus
And then checks the exit code.
Could you run the above command yourself and then echo $? to get the exit code? That should echo 1. If that is true, then unfortunately it seems like your Xcode installation has a problem.
Maybe reinstall Xcode and instead of using the terminal to accept the license, just open Xcode.
I don't see where you specifically say it, but like the message says, you did launch XCode since install/update and accept the EULA there, yes?

Development Platform using PhoneGap on a Mac Pro

I am setting up a development platform using my Mac Pro. I have installed GIT, NODEJS, PhoneGap and Cordova. I have cloned a repository to my computer successfully and added the IOS platform. But when I go to build my project I get an error:
Command failed with exit code 2.
Is there something else I need to install?
here is my error:
bash-3.2# sudo -s
bash-3.2# phonegap build ios
[phonegap] executing
'cordova build ios'... Running command:
/Users/developer/PhoneBook/DOR_Phonebook_mobile/DorPhonebook/platforms/ios/cordova/build
xcode-select: error: tool 'xcodebuild' requires Xcode, but active
developer directory '/Library/Developer/CommandLineTools' is a command
line tools instance
ERROR building one of the platforms: Error:
/Users/developer/PhoneBook/DOR_Phonebook_mobile/DorPhonebook/platforms/ios/cordova/build:
Command failed with exit code 2 You may not have the required
environment or OS to build this project
Error:
/Users/developer/PhoneBook/DOR_Phonebook_mobile/DorPhonebook/platforms/ios/cordova/build:
Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
First off all, you don't need Cordova and PhoneGap because you just install the same thing with another name.
After you choosed the name which sounds better for you, you should solve your XCode Problem. There is already a question here on Stackoverflow -> Unable to use xcode-commandlinetools.
As i can see it over there, i first would recommend you to check whether you have installed the latest version of xcode and node. If you already have the latest version, try to re-install Xcode or try to run
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
After you did all like i said try to create a project again.

Problems with Getting Started with Ionic OSX

I have a problem when it comes starting with ionic in Mac. I'll explain the steps I have taken and errors I found, to see if anyone can help me.
I installed node.js from this site: nodejs.org
Thereupon I executed these commands:
$ sudo npm install -g cordova ionic cordova
$ ionic start myApp tabs
$ ionic serve
And with this last order I can see the application running. but if I try to do this:
$ sudo ionic platform add ios
I get this error:
But, These are the versions of the programs I use:
cordova - 3.6.3-0.2.13
Ionic - 1.2.7 Xcode - 6.0.1 (6A317)
XAMPP - 1.8.3-3
Someone could help me solve my problem?
Thank you in advance.
The error message says the problem, "Cordova can only run in Xcode version 4.6 or greater."
You need to install Xcode and the Xcode command line tools. Download Xcode from the AppStore, and run this command in the terminal to get the command line tools.
xcode-select --install
Also do not use sudo with the ionic commands. You'll possibly cause permission issues down the road.

Resources