Sometimes when i try to build my ios project on xcode i get the following error
The following build commands failed:
CompileXIB ProjectName/Classes/MainViewController.xib
Error code 65 for command: xcodebuild with args: -xcconfig,/Users/ritesh/Documents/Projects/test-app/platforms/ios/cordova/build-debug.xcconfig,-project,ProjectName.xcodeproj,ARCHS=i386,-target,ProjectName,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Users/ritesh/Documents/Projects/test-app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/ritesh/Documents/Projects/test-app/platforms/ios/build/sharedpch
ERROR building one of the platforms: Error: /Users/ritesh/Documents/Projects/test-app/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/ritesh/Documents/Projects/test-app/platforms/ios/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139: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)
I read this bolog post and while his suggestion makes sense but I dont have a duplicate of the file which he said i should see when i open my .pbxproj file.
https://medium.com/@_qzapaia/cordova-ionic-ios-build-error-697a7ec5b46#.snruarnmz
if i build my project for the second time, it builds properly so im not sure what is causing this occasionally. Any clues from anyone?
Cheers
Run (this will remove the old ionic ios platform)
sudo ionic platform rm ios
Then (this will install a new platform with privileges)
sudo ionic platform add ios
Then build your code ios/android
ionic build ios
ionic build android
This fixed it for me!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With