Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10012] Android: App intermittently crashes on app restart

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-09-06T02:26:32.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sSprint 2012-15 Core, Release 2.1.2, Release 3.0.0
ComponentsAndroid
Labelscore, module_webview, qe-review, qe-testadded
ReporterAllen Yeung
AssigneeAllen Yeung
Created2012-07-17T16:52:07.000+0000
Updated2012-09-06T02:26:32.000+0000

Description

var win = Ti.UI.createWindow({
    backgroundColor: '#ccc'
});
   
var webView = Ti.UI.createWebView({ url: "http://www.google.com" });
 
webView.addEventListener("load", function() {
    Ti.API.info("webView loaded");
    setInterval(doSomething, 1000);
});
   
win.add(webView);
     
win.open();
 
 
function doSomething() {
    Ti.API.info("interval triggered");
    try {
        var result = webView.evalJS("1+1");
        Ti.API.info("RESULT: " + result);
    } catch(e) {
        Ti.API.info("ERROR: " + e);
    }
}
1. Launch the code snippet 2. Browse to a different web page, and hit the 'back' button when the page is loading 3. Immediately launch the app again once the app closes. (This is some kind of race condition and happens intermittently. You may need to try several times)

Comments

  1. Ricardo Canastro 2012-07-19

    Do you get "[INFO][TiRootActivity( 518)] (main) [0,0] checkpoint, on root activity create, savedInstanceState: null" ?
  2. Allen Yeung 2012-07-19

    That message is debug info that shows up quite often, and is not related to this issue.
  3. Ricardo Canastro 2012-07-20

    In my application all the time I close and try immediatly to open the application it crashes and I get that savedInstanceState null and a SIGSEGV error. I'm trying to figure out if this is the same bug you are experiencing... My log on DDMS while running on a device (LG P500 Android 2.3.7): http://pastebin.com/8ihM1GM8
  4. Allen Yeung 2012-07-27

    @Ricardo From the logs, I'm not sure if it's the same bug you experiencing. I am submitting a PR for this, so you can test it out. If you are still having problems, please narrow it down to a simple test case and submit a separate bug. Thanks, Allen
  5. Allen Yeung 2012-07-27

    PR Ready: https://github.com/appcelerator/titanium_mobile/pull/2653 To test, run the test case above. NOTE: Before my fix, the app would freeze and then ultimately crash. After my fix, the app may stay on the splash screen for a short time, and then recover (loading the app successfully). Also when you hit the fail case (after you relaunch the app successfully) you may notice that RESULT is null in the logs. This is a result of us getting the load event from the previous instance of the app and is a separate bug. When you hit this situation, you should back out of the app and verify that all the logging from the app stops (Before my fix, this used to keep on going after you back out of an app).
  6. Tamila Smolich 2012-08-15

    Closing as fixed. Tested and verified on: Titanium Studio, build: 2.1.1.201208091713 Titanium SDK, build: 2.2.0.v20120813184911 Devices: Nexus 7 tab (4.1), HTC Evo (4.0.3) Can't get crashes on app restart.
  7. Neha Chhabra 2012-09-06

    Reopening to update labels.

JSON Source