Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11320] Android: ScrollView - App crashes on launch

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-10-12T18:09:09.000+0000
Affected Version/sRelease 3.0.0
Fix Version/sRelease 3.0.0, Release 3.1.0, 2012 Sprint 21 API, 2012 Sprint 21
ComponentsAndroid
Labelsapi, module_scrollview, qe-and100112, qe-testadded
ReporterTamila Smolich
AssigneeKarl Rowley
Created2012-10-09T19:07:18.000+0000
Updated2012-10-17T22:48:41.000+0000

Description

Description: The app crashes on launch. This is a regression, does not occur on 2.1.3. Log output:
10-09 11:51:52.531: E/TiApplication(6298): (main) [11210,11210] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.0.0,2012/10/09 03:42,33c586f
10-09 11:51:52.531: E/TiApplication(6298): java.lang.NullPointerException
10-09 11:51:52.531: E/TiApplication(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.createControls(TiTableViewRowProxyItem.java:151)
10-09 11:51:52.531: E/TiApplication(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:286)
10-09 11:51:52.531: E/TiApplication(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:81)
10-09 11:51:52.531: E/TiApplication(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:226)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.AbsListView.obtainView(AbsListView.java:2451)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.ListView.makeAndAddView(ListView.java:1780)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.ListView.fillDown(ListView.java:678)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.ListView.fillFromTop(ListView.java:738)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.ListView.layoutChildren(ListView.java:1631)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.AbsListView.onLayout(AbsListView.java:2281)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
10-09 11:51:52.531: E/TiApplication(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:555)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.531: E/TiApplication(6298): 	at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:583)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.531: E/TiApplication(6298): 	at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:583)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.LinearLayout.onLayout(LinearLayout.java:1415)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1667)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2624)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.os.Handler.dispatchMessage(Handler.java:99)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.os.Looper.loop(Looper.java:137)
10-09 11:51:52.531: E/TiApplication(6298): 	at android.app.ActivityThread.main(ActivityThread.java:4517)
10-09 11:51:52.531: E/TiApplication(6298): 	at java.lang.reflect.Method.invokeNative(Native Method)
10-09 11:51:52.531: E/TiApplication(6298): 	at java.lang.reflect.Method.invoke(Method.java:511)
10-09 11:51:52.531: E/TiApplication(6298): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
10-09 11:51:52.531: E/TiApplication(6298): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
10-09 11:51:52.531: E/TiApplication(6298): 	at dalvik.system.NativeStart.main(Native Method)
10-09 11:51:52.561: E/AndroidRuntime(6298): FATAL EXCEPTION: main
10-09 11:51:52.561: E/AndroidRuntime(6298): java.lang.NullPointerException
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.createControls(TiTableViewRowProxyItem.java:151)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:286)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableViewRowProxyItem.setRowData(TiTableViewRowProxyItem.java:81)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableView$TTVListAdapter.getView(TiTableView.java:226)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.AbsListView.obtainView(AbsListView.java:2451)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.ListView.makeAndAddView(ListView.java:1780)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.ListView.fillDown(ListView.java:678)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.ListView.fillFromTop(ListView.java:738)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.ListView.layoutChildren(ListView.java:1631)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.AbsListView.onLayout(AbsListView.java:2281)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:555)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:583)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:583)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1644)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1502)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.LinearLayout.onLayout(LinearLayout.java:1415)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.widget.FrameLayout.onLayout(FrameLayout.java:431)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.View.layout(View.java:11338)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.ViewGroup.layout(ViewGroup.java:4238)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1667)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2624)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.os.Handler.dispatchMessage(Handler.java:99)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.os.Looper.loop(Looper.java:137)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at android.app.ActivityThread.main(ActivityThread.java:4517)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at java.lang.reflect.Method.invokeNative(Native Method)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at java.lang.reflect.Method.invoke(Method.java:511)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:980)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:747)
10-09 11:51:52.561: E/AndroidRuntime(6298): 	at dalvik.system.NativeStart.main(Native Method)
Steps: 1. Run the following code:
var data = [];
var win = Ti.UI.createWindow();
var row = Ti.UI.createTableViewRow({className:'scrolltab',height:67,backgroundColor:'#fff',selectionStyle:Ti.UI.iPhone.TableViewCellSelectionStyle.NONE});
var scrollView = Titanium.UI.createScrollView({
    contentWidth:500,
    contentHeight:50,
    top:10,
    height:50,
    width:230,
    borderRadius:10,
    backgroundColor:'#13386c'
});
row.add(scrollView);
var view1 = Ti.UI.createView({
    backgroundColor:'#336699',
    width:440,
    height:40,
    left:10
});
scrollView.add(view1);
// add a bunch more views to the scrollView 

data.push(row);

feedTableView = Titanium.UI.createTableView({
    data:data
});

win.add(feedTableView);
win.open();
Expected result: The app shouldn't crash Actual result: The app crashes

Comments

  1. Karl Rowley 2012-10-11

    Pull request https://github.com/appcelerator/titanium_mobile/pull/3170 on master.
  2. Karl Rowley 2012-10-11

    Pull request https://github.com/appcelerator/titanium_mobile/pull/3171 for 3_0_X branch
  3. Bill Dawson 2012-10-12

    Merged to master and 3_0_X
  4. Tamila Smolich 2012-10-17

    Closing as fixed. Verified and tested on: Titanium Studio, build: 3.0.0.201210151149 Titanium SDK, builds: 3.0.0.v20121017100120; 3.1.0.v20121017102121 Device: Nexus 7 (4.1.1)

JSON Source