我刚刚安装了Xcode 7.2.1,最新版本最新版本为7.3。我能够构建默认的ios版本,但是当我尝试构建cordova ios 4.0版时,它会出现以下错误。
The following build commands failed:
CompileC build/app.build/Debug-iphonesimulator/app.build/Objects-normal/i386/MainViewController.o app/Classes/MainViewController.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/Applications/apps/band/platforms/ios/cordova/build-debug.xcconfig,-project,app.xcodeproj,ARCHS=i386,-target,app,-configuration,Debug,-sdk,iphonesimulator,build,VALID_ARCHS=i386,CONFIGURATION_BUILD_DIR=/Applications/apps/band/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Applications/apps/band/platforms/ios/build/sharedpch
ERROR building one of the platforms: Error: /Applications/apps/band/platforms/ios/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /Applications/apps/band/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 emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:817:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5
我目前的cordova版本是5.3.1。最新版本的Ionic。所以我担心的是这个错误是由于旧版本的xcode或其他一些问题引起的。
答案 0 :(得分:0)
根据官方cordova documentation,Xcode 4.5是cordova ios 4.0.0版本的最低兼容版本。所以在你的情况下,Xcode版本应该不是问题。这可能是一些许可问题。尝试更新cordova并删除ios平台并尝试重新添加并重建。希望它有所帮助