To generally upgrade my Codova install, I did this:
- Upgraded NPM / node.js to the latest release
Upgraded Cordova
sudo npm update -g cordova
Upgraded iOS and Android
cordova platform update ios cordova platform update android
Then, I started a new build
cordova build
Unfortunately, no the iOS build fails:
The following build commands failed:
CompileC build/XXX.build/Debug-iphonesimulator/XXX.build/Objects-normal/i386/
MainViewController.o XXX/Classes/MainViewController.m normal
i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: /Users/sp21/Documents/projects/workshop/platforms/ios/cordova/build: Command failed with exit code 65
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Process.ChildProcess._handle.onexit (child_process.js:823:5)
I probably should delete and regenerate the whole project.
But before I do, I'd be interested in a better workaround.
Update 2014-10-28
Now, I get a has been modified since the precompiled header
message:
fatal error: file '/Users/USER/Documents/projects/workshop/platforms/
...ios/PROJECT/PROJECT-Prefix.pch' has been modified since the precompiled header
'/var/folders/pq/vqgwwh5h8xl0qx008k8xrc100000gp/C/com.apple.DeveloperTools/
...6.1-6A1052d/Xcode/SharedPrecompiledHeaders/PROJECT-Prefix-
...cdipadqrfuqsrbermtsnitfghaea/PROJECT-Prefix.pch.pch' was built
note: please rebuild precompiled header
'/var/folders/pq/vqgwwh5h8xl0qx008k8xrc100000gp/C/com.apple.DeveloperTools/
...6.1-6A1052d/Xcode/SharedPrecompiledHeaders/
...PROJECT-Prefix-cdipadqrfuqsrbermtsnitfghaea/PROJECT-Prefix.pch.pch'
I set up a new Cordova project to figure out what triggered the cordova 'BUILD FAILED' error on cordova-ios v 4.0.0.
Turns out its when I add the Cordova Camera plugin in iOS@4.
Also remember to disable it on 'config.xml' otherwise it will be automatically reinstalled: