我构建了一个适用于Android平台的应用程序,现在我想为iOS构建它。我收到的错误似乎并不十分清楚,而且我无法通过Google-Fu的最佳努力找到相关信息。这就是我所做的:
构建失败后,我尝试删除平台和所有插件,然后再次添加/安装它们,但无济于事。在那次失败后,我删除了该项目并重新开始使用来自存储库的新克隆,我不知道下一步该尝试什么。
这是我的离子信息:
cli packages: (/Users/bbale/nodejs/kostiziPus/node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.0
Cordova Platforms : ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
Node : v8.9.0
npm : 5.5.1
OS : OS X El Capitan
Xcode : Xcode 8.2.1 Build version 8C1002
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
这是构建尝试的一些输出。我无法将其全部包含在内,因为我只能将30K字符放入帖子的正文中。但我想我得到了相关的一些内容。
CompileC /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/Objects-normal/x86_64/CDVBarcodeScanner.o CWikPay/Plugins/phonegap-plugin-barcodescanner/CDVBarcodeScanner.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/bbale/nodejs/kostiziPush/platforms/ios
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/bbale/nodejs/kostiziPush/node_modules/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/bbale/Library/Developer/Xcode/DerivedData/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/bbale/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -Wno-c++11-extensions -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -mios-simulator-version-min=9.0 -g -fvisibility=hidden -fvisibility-inlines-hidden -Wno-sign-conversion -Wno-infinite-recursion -Wno-move -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/CWikPay-generated-files.hmap -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/CWikPay-own-target-headers.hmap -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/CWikPay-all-target-headers.hmap -iquote /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/CWikPay-project-headers.hmap -I/Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator/include -I/Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator/usr/local/lib/include -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/UninstalledProducts/include -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/UninstalledProducts/iphonesimulator/include -I/Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/DerivedSources/x86_64 -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/DerivedSources -F/Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator -FCWikPay/Plugins/cordova-plugin-googleplus -FCWikPay/Plugins/cordova-plugin-facebook4 -include /Users/bbale/nodejs/kostiziPush/platforms/ios/build/sharedpch/CWikPay-Prefix-flmtzfdhgtekwthaadlusksyrtrc/CWikPay-Prefix.pch -MMD -MT dependencies -MF /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/Objects-normal/x86_64/CDVBarcodeScanner.d --serialize-diagnostics /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/Objects-normal/x86_64/CDVBarcodeScanner.dia -c /Users/bbale/nodejs/kostiziPush/platforms/ios/CWikPay/Plugins/phonegap-plugin-barcodescanner/CDVBarcodeScanner.mm -o /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/Objects-normal/x86_64/CDVBarcodeScanner.o
/Users/bbale/nodejs/kostiziPush/platforms/ios/CWikPay/Plugins/phonegap-plugin-barcodescanner/CDVBarcodeScanner.mm:282:17: warning: method definition for 'captureOutput:didOutputSampleBuffer:fromConnection:' not found [-Wincomplete-implementation]
@implementation CDVbcsProcessor
^
/Users/bbale/nodejs/kostiziPush/platforms/ios/CWikPay/Plugins/phonegap-plugin-barcodescanner/CDVBarcodeScanner.mm:78:1: note: method 'captureOutput:didOutputSampleBuffer:fromConnection:' declared here
- (void)captureOutput:(AVCaptureOutput*)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection*)connection;
^
/Users/bbale/nodejs/kostiziPush/platforms/ios/CWikPay/Plugins/phonegap-plugin-barcodescanner/CDVBarcodeScanner.mm:1027:9: error: unexpected '@' in program
if (@available(iOS 11.0, *)) {
^
/Users/bbale/nodejs/kostiziPush/platforms/ios/CWikPay/Plugins/phonegap-plugin-barcodescanner/CDVBarcodeScanner.mm:1028:92: error: property 'safeAreaLayoutGuide' not found on object of type 'UIView *'
bounds = CGRectMake(bounds.origin.x, bounds.origin.y, bounds.size.width, self.view.safeAreaLayoutGuide.layoutFrame.size.height+self.view.safeAreaLayoutGuide.layoutFrame.origin.y);
^
/Users/bbale/nodejs/kostiziPush/platforms/ios/CWikPay/Plugins/phonegap-plugin-barcodescanner/CDVBarcodeScanner.mm:1028:146: error: property 'safeAreaLayoutGuide' not found on object of type 'UIView *'
bounds = CGRectMake(bounds.origin.x, bounds.origin.y, bounds.size.width, self.view.safeAreaLayoutGuide.layoutFrame.size.height+self.view.safeAreaLayoutGuide.layoutFrame.origin.y);
^
1 warning and 3 errors generated.
CompileC /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/Objects-normal/x86_64/LaunchNavigator.o CWikPay/Plugins/uk.co.workingedge.phonegap.plugin.launchnavigator/LaunchNavigator.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/bbale/nodejs/kostiziPush/platforms/ios
export LANG=en_US.US-ASCII
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/bbale/nodejs/kostiziPush/node_modules/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=c99 -fobjc-arc -fmodules -gmodules -fmodules-cache-path=/Users/bbale/Library/Developer/Xcode/DerivedData/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/bbale/Library/Developer/Xcode/DerivedData/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wno-implicit-atomic-properties -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=9.0 -g -fvisibility=hidden -Wno-sign-conversion -Wno-infinite-recursion -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/CWikPay-generated-files.hmap -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/CWikPay-own-target-headers.hmap -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/CWikPay-all-target-headers.hmap -iquote /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/CWikPay-project-headers.hmap -I/Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator/include -I/Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator/usr/local/lib/include -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/UninstalledProducts/include -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/UninstalledProducts/iphonesimulator/include -I/Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/DerivedSources/x86_64 -I/Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/DerivedSources -F/Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator -FCWikPay/Plugins/cordova-plugin-googleplus -FCWikPay/Plugins/cordova-plugin-facebook4 -include /Users/bbale/nodejs/kostiziPush/platforms/ios/build/sharedpch/CWikPay-Prefix-frrsmamqlpzzghgslciomghcaqkm/CWikPay-Prefix.pch -MMD -MT dependencies -MF /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/Objects-normal/x86_64/LaunchNavigator.d --serialize-diagnostics /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/Objects-normal/x86_64/LaunchNavigator.dia -c /Users/bbale/nodejs/kostiziPush/platforms/ios/CWikPay/Plugins/uk.co.workingedge.phonegap.plugin.launchnavigator/LaunchNavigator.m -o /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/Objects-normal/x86_64/LaunchNavigator.o
/Users/bbale/nodejs/kostiziPush/platforms/ios/CWikPay/Plugins/uk.co.workingedge.phonegap.plugin.launchnavigator/LaunchNavigator.m:1430:56: warning: 'CFURLCreateStringByAddingPercentEscapes' is deprecated: first deprecated in iOS 9.0 - Use [NSString stringByAddingPercentEncodingWithAllowedCharacters:] instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent (since each URL component or subcomponent has different rules for what characters are valid). [-Wdeprecated-declarations]
NSString* newString = (__bridge_transfer NSString*)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault, (__bridge CFStringRef)queryParam, NULL, (CFStringRef)@"!*'();:@&=+$,/?%#[]", kCFStringEncodingUTF8);
^
In module 'Foundation' imported from /Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator/include/Cordova/CDVPlugin.h:20:
In module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:398:13: note: 'CFURLCreateStringByAddingPercentEscapes' has been explicitly marked deprecated here
CFStringRef CFURLCreateStringByAddingPercentEscapes(CFAllocatorRef allocator, CFStringRef originalString, CFStringRef charactersToLeaveUnescaped, CFStringRef legalURLCharactersToBeEscaped, CFStringEncoding encoding) CF_DEPRECATED(10_0, 10_11, 2_0, 9_0, "Use [NSString stringByAddingPercentEncodingWithAllowedCharacters:] instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent (since each URL component or subcomponent has different rules for what characters are valid).");
^
** BUILD FAILED **
The following build commands failed:
CompileC /Users/bbale/Library/Developer/Xcode/DerivedData/CWikPay-dvcxvejyqnkgeobfltsgdrhfzqwi/Build/Intermediates/CWikPay.build/Debug-iphonesimulator/CWikPay.build/Objects-normal/x86_64/CDVBarcodeScanner.o CWikPay/Plugins/phonegap-plugin-barcodescanner/CDVBarcodeScanner.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Error: Error code 65 for command: xcodebuild with args: -xcconfig,/Users/bbale/nodejs/kostiziPush/platforms/ios/cordova/build-debug.xcconfig,-workspace,CWikPay.xcworkspace,-scheme,CWikPay,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone SE,build,CONFIGURATION_BUILD_DIR=/Users/bbale/nodejs/kostiziPush/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/bbale/nodejs/kostiziPush/platforms/ios/build/sharedpch
[ERROR] An error occurred while running cordova run ios --emulator (exit code 1).
这里有很多解包方法,但我首先怀疑的是,对于phonegap-plugin-barcodescanner的iOS实现存在问题,或者它可能是一个依赖性问题,可以通过安装正确版本的东西。
如何解决这个问题,而不是从头开始构建一个全新的应用程序?
答案 0 :(得分:0)
我发现phonegap-plugin-barcodescanner需要xCode 9或更高版本才能在El Capitan上运行,因此2007 iMac硬件无法成功完成该构建。我现在有一个更新的Mac Mini与macOS High Sierra(10.13.5)和最新版本的xCode(9.4.1)。升级让我超过了这个错误。
更多详情:https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/682