-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: Launch freeze/crash on manual splash screen hiding #5324
Comments
Download a demo app here: http://1drv.ms/20rf9fu
Start the app and see the splash screen not go away when it should. If it does go away, kill the app and start it again. Repeat until reproduced. |
@mhartington Please have someone look at this to at least reproduce and get the case going. I will also write on the Cordova Dev mailing list. |
As said, personally I wasn't able to reproduce without Ionic. But maybe someone will. In such a case we can close the case here and move it in Cordova's Jira. |
try with the latest version of the splash plugin on github that has the AutoHideSplashScreen problem fixed |
@jcesarmobile I know. But this problem occurs with a plugin version from the latest master. See the config.xml in the demo app (ionicSplash.zip). |
cc @daserge |
Ok so I've been able to replicate this but it's very hit and miss. I see it once, kill the process, and it works fine again. But I haven't been able to pin point the exact cause of it yet |
@mhartington If you clone https://github.com/rossholdway/ionic-ios-cordova-bug and run that on an actual device the 'freeze' frequently occurs. (manually booting angular seems to cause it a lot, maybe some sort of race condition). |
Now check this out Mike: Remove the device plugin from the config, then ionic state clear, ionic platform add ios and ionic emulate ios. I tried pretty hard to reproduce in such a case but the problem oddly disappeared. |
I mean, try it with the latest version of the splash plugin on github that has the AutoHideSplashScreen problem fixed, because maybe your issue is fixed too, just to confirm. |
@jcesarmobile I'm pulling the plugin right from github and can see it |
@jcesarmobile not sure how to make myself anymore clearer. I do use the latest version from master, not 3.1.0. |
Okay so some update information |
Still very hit and miss, but this does seem like a race condition @zarko-tg and @rossholdway, can you try this out in our demos? .run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
console.log('Calling splashscreen hide');
}).then(function(){
navigator.splashscreen.hide();
});
}) |
@mhartington true. Other than that, if you wrap the hide call for example with a setTimeout of couple of seconds, the problem will be gone. I thus suspect some race condition in Cordova, Ionic/Angular or in relation to one another. I had a hard time scratching my head today. |
@mhartington first thing tomorrow. I'm still on Windows at home for some reason. |
There's some work-arounds right now, like moving that splashscreen.hide call into the |
I'm not sure my issue #5318 is related to the splash screen... The app sometimes freezes for me before the console.log can output anything. |
Hi guys, // Add Asset Catalog specific prefixes
if ([imageName isEqualToString:@"LaunchImage"])
{
if (device.iPhone4 || device.iPhone5 || device.iPad) {
imageName = [imageName stringByAppendingString:@"-700"];
} else if(device.iPhone6) {
imageName = [imageName stringByAppendingString:@"-800"];
} else if(device.iPhone6Plus) {
imageName = [imageName stringByAppendingString:@"-800"];
if (currentOrientation == UIInterfaceOrientationPortrait || currentOrientation == UIInterfaceOrientationPortraitUpsideDown)
{
imageName = [imageName stringByAppendingString:@"-Portrait"];
}
}
} Otherwise the splashscreen will not even show because of the image could not be found: |
@mhartington making the call to navigator.splashscreen.hide after $ionicPlatform.ready resolved does not make a big difference as it is stil possible to reproduce. However, the mystery deepened even further after some more testing with the following code: .run(function($ionicPlatform) {
var t = performance.now();
console.log('Calling $ionicPlatform.ready');
$ionicPlatform.ready(function() {
console.log('$ionicPlatform.ready took ' + (performance.now() - t) + ' ms.');
t = performance.now();
}).then(function() {
console.log(
'$ionicPlatform.ready resolve took ' + (performance.now() - t) + ' ms. '
+ 'Calling navigator.splashscreen.hide'
);
navigator.splashscreen.hide();
console.log('navigator.splashscreen.hide called');
});
}) when ran on my iPhone 6 (with iOS 9.3 13E5191d). Here's some of the log output taken using idevicesyslog | grep ionicSplash:
As you can see, the first attempt until 09:50:41 goes well. (In meantime I kill the app and start it again at 09:50:41). If the log is to be trusted, not even the callback of Angular's run gets executed. And here comes the fun part - I decided to just set AutoHideSplashScreen to true and comment out navigator.splashscreen.hide(); in the code above. At some attempt after killing the app and starting it, the spash screen would get auto-hidden as expected but the app (UI) would become unresponsive and eventually crash. Again, the logger didn't indicate that anything was executed in the callback of Angular's run method. So @rossholdway could be right. |
Update: it repros on 5.4 as well. |
What I just found out is that the problem occurs when using cordova-ios engine 4.0.1 but not when using 3.9.2. Note that in both cases I used the cordova 6.0.0 CLI. |
@zarko-tg I can also confirm that the issue only happens with Cordova iOS 4.0.0 and 4.0.1. |
cc @shazron |
Has anyone been able to replicate this with using ionic or angular? |
@mhartington Just switched to it after that message and 8 restarts and no issue. |
Just upgraded to ios 4.1.1 and white screen after splash screen :( @mhartington |
Please check the safari dev tools for errors. Also update any plugins you have installed |
@mhartington |
Guess it's fixed :) thank you |
Still able to reproduce it on an iPad 8.4 and Cordova iOS 4.1.1. No errors shown. Reverting to iOS 3.9.2 solves the issue |
Hi guys,I have to publish app to test flight today and i just used 3 hours to fix this... Last time I changed the code, the app was working great on my own iPhone, but today the app only work for emulator but not the real phone. I tried all the things you guys said but it all doesn't. My boss just added me to the company develop team account yesterday, but today I am still using my own account (not paid), so after I change the provisioning file to the develop team, the app doesn't stuck at splash screen anymore. my ios version is 3.9.2 I hope this is helpful. |
After I change the backend url, my trick doesn't work :( and I tried all the solution above this comment, the app still stuck at a white screen with a spinning loader :S |
@BVJin, the issue does not reproduce for me neither on cordova-ios@3, nor on cordova-ios@4 with ionic tabs template. Which device and iOS versions are you using? |
upgraded to cordova-ios@4 and I still got the problem. I fixed/patch it by wrapping $ionicPlatform.ready's content with a $timeout of 100 ms. I am hiding the splash screen on "deviceready" event, wich is also inside. Here's the pseudo code: $ionicPlatform.ready I was noting that the: but with the timeout, now it's working each time! just wanted to let you know how I fixed it! Still looking for a real fix! ;) |
Please make sure you're also upgrading the plugins etc. It's more than just updating the platform, you need to make sure the plugins are updated as well. |
My project was generated using Visual Studio 2015. |
@daserge I tried both ios@3 and ios@4, and they don't work. |
@mhartington upgraded the device plugin (which was 1.1.1) to 1.1.2 and the Splashscreen plugin was already to the last 3.1.0 release. I removed my "fix" and still have the splashscreen hanging sadly :( |
@baltazarqc, the latest published splashscreen version is |
@daserge hmm, I'll try to manually install it, because inside VS config.xml interface, when I remove and add the suggested, it install the 3.1.0 version. Thank you, will upgrade then try again! Will keep you informed. |
@mhartington is cli or I have to cordova rm and cordova add one by one? |
@daserge actually, it's 4.0.0! https://github.com/apache/cordova-plugin-splashscreen <<< |
That's the version in development, latest release is 3.2.2 https://github.com/apache/cordova-plugin-splashscreen/releases |
@BVJin yes, state reset will clear everything out and add them back. |
thank you @jcesarmobile ! will take this one! ;) |
@mhartington I just ionic state reset and this is plugin I have: cordova-plugin-console 1.0.3 "Console" it doesn't fix the issue. As @jcesarmobile said, the splash plugin already update to 3.2.2, so I manually cordova rm and cordova add 3.2.2 still white screen... |
@BVJin can you attach the safari dev tools? Maybe it's something else? |
@mhartington I did that all the time, no errors and warnings |
might be an access url? http://cordova.apache.org/docs/en/latest/config_ref/index.html#access |
Been fighting this issue all afternoon... I reverted cordova-ios: First thing I noticed was that I had a JavaScript error in my app, right after startup (just a silly bug that threw an error). |
i confirm this bug, working fine on my phones and crush happened only on tablet nexus 7, im using cordova 6.1.1. |
Please make sure you updating your plugins, your platforms and everything else. |
Type: bug
Ionic Version: 1.x
Platform: ios 9 webview
Experiencing a rather critical issue since getting on Cordova 6.0.0 for iOS. We have a scenario where we hide the Cordova splash screen manually relatively shortly after app launch. The problem is that quite often during launch the app just stays on the splash screen instead of continuing after hiding it, and eventually crashes. It looks like some sort of race condition at least from a user perspective.
Some testing shows with a good certainty that:
Use a cordova-plugin-splashscreen from its latest Github master branch since its latest "stable" version 3.1.0 has a bug related to the AutoHideSplashScreen config.xml parameter.
This might just be a pure Cordova core or plugins bug but as said - so far I haven't been able to trigger it with an app that doesn't use Ionic.
My system information:
Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.0
Gulp local:
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
ios-deploy version: 1.8.4
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v4.2.4
Xcode version: Xcode 7.2.1 Build version 7C1002
cordova-ios 4.0.1
The text was updated successfully, but these errors were encountered: