cordova-plugin-wkwebview-engine
cordova-plugin-wkwebview-engine copied to clipboard
conflict with splashscreen plugin
If you use the cordova-plugin-splashscreen, make sure that the autohidesplasscreen value is set to true in your config.xml as below:
<preference name="AutoHideSplashScreen" value="true"/>
Otherwise an exception is thrown in the native code that it cannot remove an observer from CDVsplashscreen and your app will hang. You can reproduce by adding the splashscreen plugin with the value set to false on any default project and just watch the native console output in xcode. Does throw anything in the javascript console so if you aren't running in xcode you will be incredibly frustrated.
Hello! Thanks for using Ionic! Would you be able to post the following info?
- ios version
- exact error you are getting
I tried this but no luck so far. Thing is i get blank white screen after the app is loaded (splashscreen fades out), and got stuck. I press the home button to go home and then reopening the app loads the screen. any idea?
@ozexpert what version of IOS are you testing with? Also, do you get any errors when this happens? Thanks!
@jgw96 hi, im using ios 9.3. cordova 6.3.1, ios cordova 4.2.0. and your latest wkwebview plugin.
although i am getting websql error, opening app second time always resolves the issue.
Hello! Websql is actually not supported in WKWebView since it was deprecated and is not a web standard anymore. https://www.w3.org/TR/webdatabase/ Would you mind trying without websql? Thanks!
Hello,
I get same error as @ghenry22 when using cordova-plugin-splashscreen with AutoHideSplashScreen set to true.
I get this error:
*** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <CDVSplashScreen 0x15de683f0> for the key path "frame" from <UIView 0x15de4bf60> because it is not registered as an observer.'
*** First throw call stack:
(0x181adadb0 0x18113ff80 0x181adacf8 0x1823f10a8 0x1823f0b84 0x1000fa648 0x1000fc180 0x1000f9a30 0x1001621b8 0x100149cdc 0x100149b34 0x189abccd0 0x189a64a10 0x189a668f0 0x1898c19dc 0x189a468cc 0x18987d218 0x18987f2c4 0x1856c7ba8 0x1856c8204 0x181a9109c 0x181a90b30 0x181a8e830 0x1819b8c50 0x1832a0088 0x186ca2088 0x1000f1874 0x1815568b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
iOS 9.3. cordova 6.3.1, ios cordova 4.1.0. latest wkwebview plugin. cordova-plugin-splashscreen 3.2.2
Yep that's the exact error I got as well.
Gaven
On Sat, Aug 20, 2016 at 5:51 AM +0800, "Jesper Johansen" [email protected] wrote:
Hello,
I get same error as @ghenry22 when using cordova-plugin-splashscreen with AutoHideSplashScreen set to true.
I get this error:
*** Terminating app due to uncaught exception 'NSRangeException', reason: 'Cannot remove an observer <CDVSplashScreen 0x15de683f0> for the key path "frame" from <UIView 0x15de4bf60> because it is not registered as an observer.' *** First throw call stack: (0x181adadb0 0x18113ff80 0x181adacf8 0x1823f10a8 0x1823f0b84 0x1000fa648 0x1000fc180 0x1000f9a30 0x1001621b8 0x100149cdc 0x100149b34 0x189abccd0 0x189a64a10 0x189a668f0 0x1898c19dc 0x189a468cc 0x18987d218 0x18987f2c4 0x1856c7ba8 0x1856c8204 0x181a9109c 0x181a90b30 0x181a8e830 0x1819b8c50 0x1832a0088 0x186ca2088 0x1000f1874 0x1815568b8) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)
iOS 9.3. cordova 6.3.1, ios cordova 4.1.0. latest wkwebview plugin.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
This thread is about the splash screen plugin not websql
@ghenry22 working on this right now :)
@ghenry22 I can't reproduce the crash, can you run:
ionic info
cordova info
cordova plugins
cordova platforms
and post the results? thank you!
I'll have time tomorrow to do this, I'll create a sample repo for reference as well
ok this is weird.
I just created a new project, added the splashscreen plugin and the specified setting and some hide and show commands within the app and it all works as expected.
for reference:
Cordova CLI: 6.3.1 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.10 Ionic CLI Version: 2.0.0-beta.37 Ionic App Lib Version: 2.0.0-beta.20 ios-deploy version: 1.8.6 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v5.11.1 Xcode version: Xcode 7.3.1 Build version 7D1014
ios 9.3 simulator used to test in both cases with latest ios platform and latest release of splashscreen plugin
@ghenry22 it is not that weird. Cordova CLI uses to fail silently... removing platforms/ and plugins/ folder and starting from scratch is a good way to fix most of the problems.
^Try that in your app
Also, when you reinstalled it might download the latest iOS platform (4.2.0) and splash screen plugin. I am not sure, the cordova team might fixed the issue.
No problem, I am happy to have this closed for now as I cannot recreate it with a clean new project.
ok! feel free to add any new information and I will reopen!
Ok narrowed this down
This happens when: you are using ionic-native you call Splashscreen.hide() when the splashscreen is not being displayed
calling Splashscreen.show() when the splashscreen is already showing has no issues.
ionic-native might be able to put a check in place to handle this.
only seems to happen with wkwebview, uiwebview has no issue.
@ghenry22 I continue not being able to reproduce this issue, i am calling Splashscreen.hide() when the splashscreen is not being displayed and AutoHideSplashScreen both false/true without success.
Can you provide an minimum repo that reproduces the issue? did you ever tried to remove the plugins/ and platforms/ folder and recreate cordova from scratch?
I have the same problem too, as well as the others, see: https://issues.apache.org/jira/browse/CB-11089
Finally, I was able to resolve by setting this plugin's version to 1.0.3
I ended up having to remove the splashscreen plugin altogether, because setting <preference name="AutoHideSplashScreen" value="true"/>
fixed the immediate issue but broke Ionic deployments.