Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9912] Android: Label: Application crashes on updating textid of label with a key that missing

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-06-20T07:06:21.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sRelease 2.1.1, Release 3.0.0
ComponentsAndroid
Labelsapi, module_label, qe-testadded, regression
ReporterSatyam Sekhri
AssigneeJosh Roesslein
Created2012-07-10T03:32:11.000+0000
Updated2013-11-07T05:27:19.000+0000

Description

Updating the textid of a label with a resource key that does not exist in the locale file, throws an exception and crashed the app. Regression. The issue does not exist in 2.0.2 Steps to Reproduce: 1. Create an application with code below 2. Launch App Actual Result: The application opens and then crashes. An exception si shown in the console. Please find attched the logs for the same. Expected: Blank label should be shown.
var  win = Titanium.UI.createWindow({
                    backgroundColor:'white',
                });
                 
            var view = Ti.UI.createView({
            top:0,
            height:80,
            right:0,
            left:0
        }); 
         
var label =  Ti.UI.createLabel({
    font:{fontSize:30,fontFamily:'Helvetica Neue'},
    color:'red',
    left:0,
    width:'100%',
    //text:'Label1',
    textid:'new',
    right:'10%',
    textid:'check'
});
view.add(label);

Ti.API.info('Updating1');
     label.textid='new';
     Ti.API.info('Updating2');
     label.textid='new';
     Ti.API.info('Updating3');
     label.textid='new';
     Ti.API.info('Updating4');
     label.textid='new';

        view.addEventListener('click',function(e){
        //label.text = 'Label1 is fine';
        label.textid='new';
    })
             
win.add(view)
                 
win.open();

Comments

  1. Josh Roesslein 2012-07-13

    This issue is caused by the same bug which was fixed in TIMOB-8774.
  2. Josh Roesslein 2012-07-13

    Issued resolved and has already been back ported into 2.1.1.
  3. Anshu Mittal 2012-07-17

    Verified On: SDK: 2.2.0.v20120713210112 Studio: 2.1.1.201207161421 Device: Samsung Tab(V 3.2)
  4. Anshu Mittal 2012-07-17

    Verified On: SDK: 2.1.1.v20120716180600 Studio: 2.1.1.201207161421 Device: Samsung Galaxy tab(V 3.2) Application does not crash on updating textid of label.
  5. Priya Agarwal 2013-06-20

    Reopening just to update labels.
  6. Priya Agarwal 2013-06-20

    Updated label and verified with: Tested on: Device: Nexus 7 tab Android Version 4.1 SDK:3.1.2.v20130619101604 Appcelerator Studio: 3.1.1.201306131423 OS: OSX 10.8 acs:1.0.3 alloy:1.1.3 npm:1.2.14 titanium:3.1.1 titanium-code-processor:1.0.1
  7. Shameer Jan 2013-11-07

    Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/4787

JSON Source