我无法在Mac上使用cordova构建我的应用的iOS版本。当我在同一台机器上为Android运行此命令时,我收到一条成功消息,
cordova build android
BUILD SUCCESSFUL
Total time: 1 mins 53.473 secs
Built the following apk(s):
/Volumes/data/app/webapp/cordova/platforms/android/build/outputs/apk/android-debug.apk
但是如果我尝试使用此命令为iOS生成,我会收到如下所示的错误。
cordova build ios
/Volumes/data/app/webapp/cordova/platforms/ios/TheApp/Plugins/cordova-plugin-device/CDVDevice.m:24:9: fatal error:
'Cordova/CDV.h' file not found
#import <Cordova/CDV.h>
^
1 error generated.
** BUILD FAILED **
The following build commands failed:
CompileC /Users/User/Library/Developer/Xcode/DerivedData/MyApp-fliapfgngglxfnbapiyopwlziapf/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/AppDelegate.o MyApp/Classes/AppDelegate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/User/Library/Developer/Xcode/DerivedData/MyApp-fliapfgngglxfnbapiyopwlziapf/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/MainViewController.o MyApp/Classes/MainViewController.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
CompileC /Users/User/Library/Developer/Xcode/DerivedData/MyApp-fliapfgngglxfnbapiyopwlziapf/Build/Intermediates/MyApp.build/Debug-iphonesimulator/MyApp.build/Objects-normal/x86_64/CDVDevice.o MyApp/Plugins/cordova-plugin-device/CDVDevice.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(3 failures)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Volumes/data/app/webapp/cordova/platforms/ios/cordova/build-debug.xcconfig,-workspace,TheApp.xcworkspace,-scheme,TheApp,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone 6s Plus,build,CONFIGURATION_BUILD_DIR=/Volumes/data/app/webapp/cordova/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Volumes/data/app/webapp/cordova/platforms/ios/build/sharedpch
Users-MacBook-Pro:cordova User$
任何帮助都将受到高度赞赏,谢谢。
答案 0 :(得分:1)
在尝试了很多没有成功的方法后,我跑了:
Hence first ampersand in ("<") will be replaced as ("&lt") instead of (<).
这为我修好了。 (XCODE 7.3.1,Cordova 6.3.0)