Getting error when running 'ionic build ios'

I’m getting this error when trying to run ionic build ios.

mv: dest file already exists: /Users/joshua.hicks/Desktop/SITES/ohgo-mobile/ohgodev/platforms/ios/ohgoDev/ohgodev-Info.plist

mv: dest file already exists: /Users/joshua.hicks/Desktop/SITES/ohgo-mobile/ohgodev/platforms/ios/ohgoDev/ohgodev-Prefix.pch

shell.js: internal error
Error: EINVAL, invalid argument '/Users/joshua.hicks/Desktop/SITES/ohgo-mobile/ohgodev/platforms/ios/ohgoDev.xcodeproj'
    at Error (native)
    at Object.fs.renameSync (fs.js:636:18)
    at /usr/local/lib/node_modules/cordova/node_modules/shelljs/src/mv.js:77:8
    at Array.forEach (native)
    at Object._mv (/usr/local/lib/node_modules/cordova/node_modules/shelljs/src/mv.js:53:11)
    at Object.mv (/usr/local/lib/node_modules/cordova/node_modules/shelljs/src/common.js:186:23)
    at pbxProject.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/metadata/ios_parser.js:189:23)
    at pbxProject.emit (events.js:110:17)
    at pbxProject.<anonymous> (/usr/local/lib/node_modules/cordova/node_modules/xcode/lib/pbxProject.js:30:18)
    at ChildProcess.emit (events.js:110:17)

I ran an ‘ionic state reset’ to reset the platform folders beforehand. Android is building successfully, but ios is not building via the command line. Any ideas why this might be happening?

Have you tried running the following commands in your console:

ionic platform rm ios
ionic platform add ios

Sometimes there’s a problem with the underlying naming of files when building a project as explained here: android - Cannot build project for iOS from cordova cli - Stack Overflow and the best solution I’ve found involves removing, then re-adding the offending platform and running the build process after doing this.

I think it was something to do with that. I replaced my config.xml file and did another ionic state reset and it seems to be building now. Not sure which one of those fixed it. I’m guessing it could have been a combination of both.

Sometimes It’s more frustrating not knowing what caused the problem!

Glad it’s working now though.