Closed gustavohpaula closed 2 months ago
Crashes or gets stuck?
If it's crashing, you should see a backtrace in XCode, if you're running with the XCode debugger attached.
If it's getting stuck, it may be because of a JS error. The Safari Web Inspector can be used to observe JS errors but it won't collect any error events that occurred before the web inspector was attached. However, you should be able to refresh the webview (even if the splashscreen is still shown) by pressing cmd
+ R
while the inspector is focused. Reloading the webview while the inspector is opened may allow you catch JS issues happening in the webview.
During the test I find that the problem is because of the dependency of the WKWebViewEngine.
Can you expand what you mean by this? cordova-ios@5 has no dependency on the WKWebView, but there is a cordova-plugin-wkwebview-engine to use the wkwebview. cordova-ios@6 integrates the WKWebView making that plugin obsolete, because the old UIWebView
API deprecated and now forbidden.
The app remains stuck on the splash screen, but the safari doesn't recognize it to use the debugger. About the cordova-plugin-wkwebview-engine, we had it in our project as a dependency in order to use cordova-plugin-wkwebview-file-xhr. This plugin is vital for our business logic. We think something changed on iOS 16+, because the app runs just fine on lower versions of the OS, even with cordova-plugin-wkwebview-engine installed in our project. We've tried to upgradecordova-ios to 6.x and remove cordova-plugin-wkwebview-engine, but the situation remains the same, the app gets stuck on the splash screen with no errors.
... but the situation remains the same, the app gets stuck on the splash screen with no errors.
Including if you try:
you should be able to refresh the webview (even if the splashscreen is still shown) by pressing cmd + R while the inspector is focused. Reloading the webview while the inspector is opened may allow you catch JS issues happening in the webview.
If there is truly no log output either from the native xcode side, or when refreshing the webview view the web inspector for the JS side, then the only other explanation that I can think of is a plugin is misbehaving and potentially hanging. A brute force way of determining this is start uninstalling plugins one by one until it gets passed the splashscreen (even if it then results in an error because of a missing plugin, at least you found the likely culprit for the splashscreen hang).
I would recommend doing this on cordova-ios@5
with the cordova-plugin-wkwebview-engine
installed because that's kind of your baseline/last known working state. Once the project is stabilised again, I'd consider upgrading to cordova-ios@6
, noting the breaking changes mentioned in the release blog, and assuming that no further, consider upgrading to cordova-ios@7 (release notes). At this point you'll be completely up to date and on a supported version.
Try this in your config.xml file
<preference name="AutoHideSplashScreen" value="true" />
I used the
I have an application that uses cordova-ios@5.1.1. When running the app on iOS 16 or 17, the app crashes on the splash screen without any log on xcode and the safari don't recognize it to see the js log. During the test I find that the problem is because of the dependency of the WKWebViewEngine. I've tried to upgrade the cordova-ios to version 6 but the WKWebViewEngine is integrated on the core, so the problem persist