Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ionic ios app Build failed MainController.xib

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

like image 692
Kingsley Simon Avatar asked Oct 31 '22 16:10

Kingsley Simon


1 Answers

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!

like image 101
Sharthan Avatar answered Nov 15 '22 05:11

Sharthan