ionic 5 iOS 应用程序卡在启动画面上,没有错误日志
Posted
技术标签:
【中文标题】ionic 5 iOS 应用程序卡在启动画面上,没有错误日志【英文标题】:ionic 5 iOS app stuck on Splash Screen with no error logs 【发布时间】:2020-11-13 15:57:45 【问题描述】:我正在尝试构建基于 cordova-ios 6.1.0 和 ios 13.6 的 ionic 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
【问题讨论】:
【参考方案1】:终于,在尝试了这么多方法之后,我能够解决这个问题。
我通过在我的项目目录中运行以下命令解决了这个问题:
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
【讨论】:
以上是关于ionic 5 iOS 应用程序卡在启动画面上,没有错误日志的主要内容,如果未能解决你的问题,请参考以下文章