ionic 5 iOS 应用卡在启动画面上,没有错误日志

ionic 5 iOS app stuck on Splash Screen with no error logs

我正在尝试构建基于 cordova-ios 6.1.0 和 ios 13.6 的离子 iOS 移动应用程序。我的应用程序卡在初始屏幕上,以下是 XCode 日志。我被困在这个问题上好几天了,但仍然没有运气。有人对此有解决方案吗?

2020-11-13 21:04:22.980476+0530 Kiraly Fitness[9007:161922] Apache Cordova native platform version 6.1.0 is starting.
2020-11-13 21:04:22.980827+0530 Kiraly Fitness[9007:161922] Multi-tasking -> Device: YES, App: YES
2020-11-13 21:04:23.469793+0530 Kiraly Fitness[9007:161922] CDVWKWebViewEngine: trying to inject XHR polyfill
2020-11-13 21:04:23.481714+0530 Kiraly Fitness[9007:161922] The preference key "KeyboardResize" is not defined and will default to "TRUE"
2020-11-13 21:04:23.481996+0530 Kiraly Fitness[9007:161922] The preference key "AutoInjectCordova" is not defined and will default to "FALSE"
2020-11-13 21:04:23.482185+0530 Kiraly Fitness[9007:161922] The preference key "AudioCanMix" is not defined and will default to "FALSE"
2020-11-13 21:04:23.509558+0530 Kiraly Fitness[9007:161922] The preference key "WKSuspendInBackground" is not defined and will default to "TRUE"
2020-11-13 21:04:23.509790+0530 Kiraly Fitness[9007:161922] The preference key "MediaPlaybackAllowsAirPlay" is not defined and will default to "TRUE"
2020-11-13 21:04:23.793406+0530 Kiraly Fitness[9007:161922] WF: === Starting WebFilter logging for process Kiraly Fitness
2020-11-13 21:04:23.793672+0530 Kiraly Fitness[9007:161922] WF: _userSettingsForUser : (null)
2020-11-13 21:04:23.793887+0530 Kiraly Fitness[9007:161922] WF: _WebFilterIsActive returning: NO
2020-11-13 21:04:23.909218+0530 Kiraly Fitness[9007:161922] The preference key "KeyboardAppearanceDark" is not defined and will default to "FALSE"
2020-11-13 21:04:23.909750+0530 Kiraly Fitness[9007:161922] The preference key "AllowLinkPreview" is not defined and will default to "FALSE"
2020-11-13 21:04:23.912102+0530 Kiraly Fitness[9007:161922] The preference key "AllowBackForwardNavigationGestures" is not defined and will default to "FALSE"
2020-11-13 21:04:23.912284+0530 Kiraly Fitness[9007:161922] CDVWKWebViewEngine will reload WKWebView if required on resume
2020-11-13 21:04:23.912457+0530 Kiraly Fitness[9007:161922] Using Ionic WKWebView
2020-11-13 21:04:23.913324+0530 Kiraly Fitness[9007:161922] [CDVTimer][console] 0.169992ms
2020-11-13 21:04:23.913740+0530 Kiraly Fitness[9007:161922] [CDVTimer][handleopenurl] 0.169992ms
2020-11-13 21:04:23.916924+0530 Kiraly Fitness[9007:161922] Unlimited access to network resources
2020-11-13 21:04:23.917392+0530 Kiraly Fitness[9007:161922] Unlimited access to network resources
2020-11-13 21:04:23.917626+0530 Kiraly Fitness[9007:161922] [CDVTimer][intentandnavigationfilter] 3.692985ms
2020-11-13 21:04:23.918000+0530 Kiraly Fitness[9007:161922] [CDVTimer][gesturehandler] 0.177979ms
2020-11-13 21:04:23.922489+0530 Kiraly Fitness[9007:161922] [CDVTimer][statusbar] 4.276037ms
2020-11-13 21:04:23.925343+0530 Kiraly Fitness[9007:161922] [CDVTimer][splashscreen] 2.597094ms
2020-11-13 21:04:23.934488+0530 Kiraly Fitness[9007:161922] The preference key "KeyboardResize" is not defined and will default to "TRUE"
2020-11-13 21:04:23.934704+0530 Kiraly Fitness[9007:161922] CDVIonicKeyboard: resize mode 1
2020-11-13 21:04:23.935362+0530 Kiraly Fitness[9007:161922] The preference key "HideKeyboardFormAccessoryBar" is not defined and will default to "TRUE"
2020-11-13 21:04:23.937372+0530 Kiraly Fitness[9007:161922] The preference key "KeyboardAppearanceDark" is not defined and will default to "FALSE"
2020-11-13 21:04:23.938561+0530 Kiraly Fitness[9007:161922] [CDVTimer][cdvionickeyboard] 6.577015ms
2020-11-13 21:04:23.943178+0530 Kiraly Fitness[9007:161922] [CDVTimer][file] 3.783941ms
2020-11-13 21:04:23.944279+0530 Kiraly Fitness[9007:161922] [CDVTimer][paypalmobile] 0.138044ms
2020-11-13 21:04:23.950443+0530 Kiraly Fitness[9007:161922] [CDVTimer][cdvwkwebviewfilexhr] 5.802989ms
2020-11-13 21:04:23.950708+0530 Kiraly Fitness[9007:161922] [CDVTimer][TotalPluginStartup] 37.629008ms
2020-11-13 21:04:24.086768+0530 Kiraly Fitness[9007:161922] DidFinishLaunchingWithOptions
2020-11-13 21:04:24.174174+0530 Kiraly Fitness[9007:161922] app become active
2020-11-13 21:04:24.557624+0530 Kiraly Fitness[9007:161922] Device FCM Token: dqJks6p7GEgHt-2EczLTFY:APA91bGDsY-7tCz4TGoerUxtqREWNoZW_ZTPcIwUDcn6b0D0AArlJhLjn0thhr1MXSzkL-IB01-TSFcx4F8QPSJfQFQA5GoxdlYtqqrqR22ILEEmnjCRw2zSZIDL_vmTTshY22CQJe5I
2020-11-13 21:04:29.683167+0530 Kiraly Fitness[9007:161922] Cordova view ready
2020-11-13 21:04:30.094023+0530 Kiraly Fitness[9007:161922] start Js Event Bridge
2020-11-13 21:04:30.136804+0530 Kiraly Fitness[9007:161922] FCM: has been created
2020-11-13 21:04:30.137898+0530 Kiraly Fitness[9007:161922] FCM: Ready!
2020-11-13 21:04:30.138138+0530 Kiraly Fitness[9007:161922] Ionic Native: deviceready event fired after 3266 ms
2020-11-13 21:04:30.138519+0530 Kiraly Fitness[9007:161922] Ionic Native: deviceready event fired after 3191 ms

终于在尝试了很多方法后,终于解决了这个问题。

我已经通过 运行 对我的 项目目录 以下命令解决了这个问题:

npm install

sudo gem install cocoapods

pod repo update

ionic cordova platform add ios@5.1.0

cordova plugin update cordova-plugin-ionic-webview@latest

然后我将以下内容添加到 ios 平台

下的 config.xml
<feature name="CDVWKWebViewEngine">
<param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />

不加
<preference name="WKWebViewOnly" value="true" />

然后在项目目录中,

ionic cordova prepare ios

cordova build ios