Reputation: 725
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)
Upvotes: 1
Views: 196
Reputation: 3803
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.
Upvotes: 0