cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Torsten Freyhall (JIRA)" <>
Subject [jira] [Commented] (CB-10530) App freezes sometimes directly after starting on iOS
Date Wed, 17 Feb 2016 21:38:18 GMT


Torsten Freyhall commented on CB-10530:

Yes, this does indeed solve the freeze in my test project.

However I was not sure about why the timer resolves due to long script execution times though.
It seems like the intention is that whenever gap://ready is loaded in the iframe, the immediate
response from the native side should be to call nativeFetchMessages() which should clear the

Therefore I dug a little deeper in the native side, and found that the evaluateJavaScript:completionHandler:
in CDVCommandQueue expects implementation to to be async (a comment in the code says so),
but the CDVUIWebViewEngine method actually is implemented synchronous.

I wrapped the entire method in a dispatch_async call (maybe a very naive solution, it might
mess with references?):

    dispatch_async(dispatch_get_main_queue(), ^{
        NSString* ret = [(UIWebView*)_engineWebView stringByEvaluatingJavaScriptFromString:javaScriptString];

        if (completionHandler) {
            completionHandler(ret, nil);

This also solves the original issue on cordova-ios 4.0.1 as the timeout never resolves, so
maybe asyncing this method should also be a part of the proper fix?

> App freezes sometimes directly after starting on iOS
> ----------------------------------------------------
>                 Key: CB-10530
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS
>    Affects Versions: 6.0.0
>         Environment: OSX El Capitan 10.11.3, XCODE (7.2.1), iOS 9.2.1, cordova 6.0.0,
ionic 1.7.14
>            Reporter: Florian Kr├╝ger
>            Assignee: Shazron Abdullah
>            Priority: Critical
>              Labels: cordova-ios-4.1.0, triaged
>         Attachments:
> * Installed the "ionic start myApp sidemenu" example application
> * Start XCODE (7.2.1)
> * Start the app by clicking the run button from  xCODE
> * The app probably starts as expected.
> * Repeat the start process until the app freezes.
> The app sometimes freezes completely. If this happens you cannot do anything with the
app (you need to push the home button and close the app via task manager). I had the same
issue for another more complex app.
> The CPU stays at around 99% workload.
> I made a snapshot of the profiler (Instruments)

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message