gpt4 book ai didi

ios - 在 Mac IOS 上获取 Ionic 构建错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:00:14 28 4
gpt4 key购买 nike

我在为 IOS 构建 Ionic 时遇到一些错误,而 Mac 上的“Ionic serve”工作正常。

我正在运行这个命令:

ionic cordova build ios

构建错误是:

In file included from /Users/mohsinjaved/Documents/GitHub/V2/app/platforms/ios/appname/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.m:1:
/Users/mohsinjaved/Documents/GitHub/V2/app/platforms/ios/appname/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.h:4:40: error: no type or protocol named 'WKURLSchemeHandler'
@interface IONAssetHandler : NSObject <WKURLSchemeHandler>
^
/Users/mohsinjaved/Documents/GitHub/V2/app/platforms/ios/appname/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.m:10:62: error: no type or protocol named 'WKURLSchemeTask'
- (void)webView:(WKWebView *)webView startURLSchemeTask:(id <WKURLSchemeTask>)urlSchemeTask
^
/Users/mohsinjaved/Documents/GitHub/V2/app/platforms/ios/appname/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.m:50:76: error: no type or protocol named 'WKURLSchemeTask'
- (void)webView:(nonnull WKWebView *)webView stopURLSchemeTask:(nonnull id<WKURLSchemeTask>)urlSchemeTask API_AVAILABLE(ios(11.0)){
^
/Users/mohsinjaved/Documents/GitHub/V2/app/platforms/ios/appname/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.m:13:33: error: property 'request' not found on object of type '__strong id'
NSURL * url = urlSchemeTask.request.URL;
^
/Users/mohsinjaved/Documents/GitHub/V2/app/platforms/ios/appname/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.m:44:20: error: no known instance method for selector 'didReceiveResponse:'
[urlSchemeTask didReceiveResponse:response];
^~~~~~~~~~~~~~~~~~
/Users/mohsinjaved/Documents/GitHub/V2/app/platforms/ios/appname/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.m:45:20: error: no known instance method for selector 'didReceiveData:'
[urlSchemeTask didReceiveData:data];
^~~~~~~~~~~~~~
/Users/mohsinjaved/Documents/GitHub/V2/app/platforms/ios/appname/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.m:46:20: error: no known instance method for selector 'didFinish'
[urlSchemeTask didFinish];
^~~~~~~~~
7 errors generated.

CompileC /Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/Objects-normal/x86_64/GCDWebServer.o appname/Plugins/cordova-plugin-ionic-webview/GCDWebServer.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/mohsinjaved/Documents/GitHub/V2/app/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/mohsinjaved/Documents/GitHub/V2/app/node_modules/.bin:/usr/local/opt/node@10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/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/mohsinjaved/Library/Developer/Xcode/DerivedData/ModuleCache -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/Users/mohsinjaved/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/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/appname-generated-files.hmap -I/Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/appname-own-target-headers.hmap -I/Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/appname-all-target-headers.hmap -iquote /Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/appname-project-headers.hmap -I/Users/mohsinjaved/Documents/Github/V2/app/platforms/ios/build/emulator/include -I/Users/mohsinjaved/Documents/Github/V2/app/platforms/ios/build/emulator/usr/local/lib/include -I/Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/UninstalledProducts/include -I/Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/UninstalledProducts/iphonesimulator/include -I/Users/mohsinjaved/Documents/Github/V2/app/platforms/ios/build/emulator -I/Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/DerivedSources/x86_64 -I/Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/DerivedSources -F/Users/mohsinjaved/Documents/Github/V2/app/platforms/ios/build/emulator -include /Users/mohsinjaved/Documents/Github/V2/app/platforms/ios/build/sharedpch/appname-Prefix-ejxenhctjcrayehjbwsmpoicigmk/appname-Prefix.pch -MMD -MT dependencies -MF /Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/Objects-normal/x86_64/GCDWebServer.d --serialize-diagnostics /Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/Objects-normal/x86_64/GCDWebServer.dia -c /Users/mohsinjaved/Documents/GitHub/V2/app/platforms/ios/appname/Plugins/cordova-plugin-ionic-webview/GCDWebServer.m -o /Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/Objects-normal/x86_64/GCDWebServer.o

** BUILD FAILED **


The following build commands failed:
CompileC /Users/mohsinjaved/Library/Developer/Xcode/DerivedData/appname-dwzkhngrmwxjidcdydxjcxdaraat/Build/Intermediates/appname.build/Debug-iphonesimulator/appname.build/Objects-normal/x86_64/IONAssetHandler.o appname/Plugins/cordova-plugin-ionic-webview/IONAssetHandler.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
CordovaError: Promise rejected with non-error: 'Error code 65 for command: xcodebuild with args: -xcconfig,/Users/mohsinjaved/Documents/Github/V2/app/platforms/ios/cordova/build-debug.xcconfig,-workspace,appname.xcworkspace,-scheme,appname,-configuration,Debug,-sdk,iphonesimulator,-destination,platform=iOS Simulator,name=iPhone SE,build,CONFIGURATION_BUILD_DIR=/Users/mohsinjaved/Documents/Github/V2/app/platforms/ios/build/emulator,SHARED_PRECOMPS_DIR=/Users/mohsinjaved/Documents/Github/V2/app/platforms/ios/build/sharedpch'
at cli.catch.err (/usr/local/lib/node_modules/cordova/bin/cordova:30:15)
at process._tickCallback (internal/process/next_tick.js:68:7)
[ERROR] An error occurred while running subprocess cordova.

我的环境:

Mac OS: 10.12.0
xcode: 8.2.1
npm: 6.4.1

我是 Ionic-IOS 的新手,所以请指导我如何解决这个问题。在我看来这不是与代码相关的问题。

最佳答案

我通过执行以下简单步骤解决了这个问题:

  1. ionic cordova 平台删除 ios
  2. ionic cordova 平台添加 ios
  3. ionic cordova 构建 ios

希望对你也有帮助。另外,请尝试使用最新版本的 Xcode。

关于ios - 在 Mac IOS 上获取 Ionic 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53986477/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com