[TIMOB-10477] Android: The app crashes on launch on Android
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-09-05T10:00:24.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Sprint 2012-17 API, Release 3.0.0, Sprint 2012-18 API |
Components | Android |
Labels | api, module_tableview, qe-and082012, qe-review, qe-testadded |
Reporter | Tamila Smolich |
Assignee | Hieu Pham |
Created | 2012-08-16T15:14:46.000+0000 |
Updated | 2013-12-10T06:12:24.000+0000 |
Description
Description:
The app crashes on launch on Android. Tested on iOS as well and worked fine.
This is regression. Didn't exist on 2.1.0.
Steps to reproduce:
1. Run the following code:
var win = Ti.UI.createWindow({
backgroundColor:'white',
title:'test',
modal:true
});
var data1 = [];
var tvr = Ti.UI.createTableViewRow({
title:'pippo',
hasChild:true
});
data1.push(tvr);
var table = Ti.UI.createTableView({
top: 10,
left: 10,
width: 200,
height: 200,
scrollable: false,
borderRadius: 10,
backgroundColor: 'white',
data : data1
});
table.addEventListener('postlayout', function() {
setTimeout(function(){
Ti.API.info('#### postlayout table event received.');
alert('postlayout table event fired');
},600);
});
win.add(table);
win.open();
Consol output:
08-16 14:52:06.374: E/TiApplication(9450): (main) [242,242] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 2.2.0,2012/08/15 14:17,9779010
08-16 14:52:06.374: E/TiApplication(9450): java.lang.NullPointerException
08-16 14:52:06.374: E/TiApplication(9450): at java.util.HashMap.<init>(HashMap.java:195)
08-16 14:52:06.374: E/TiApplication(9450): at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:72)
08-16 14:52:06.374: E/TiApplication(9450): at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:189)
08-16 14:52:06.374: E/TiApplication(9450): at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:544)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.374: E/TiApplication(9450): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.374: E/TiApplication(9450): at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:585)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.374: E/TiApplication(9450): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.374: E/TiApplication(9450): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
08-16 14:52:06.374: E/TiApplication(9450): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
08-16 14:52:06.374: E/TiApplication(9450): at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.374: E/TiApplication(9450): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1866)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1687)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.Choreographer.doFrame(Choreographer.java:525)
08-16 14:52:06.374: E/TiApplication(9450): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
08-16 14:52:06.374: E/TiApplication(9450): at android.os.Handler.handleCallback(Handler.java:615)
08-16 14:52:06.374: E/TiApplication(9450): at android.os.Handler.dispatchMessage(Handler.java:92)
08-16 14:52:06.374: E/TiApplication(9450): at android.os.Looper.loop(Looper.java:137)
08-16 14:52:06.374: E/TiApplication(9450): at android.app.ActivityThread.main(ActivityThread.java:4745)
08-16 14:52:06.374: E/TiApplication(9450): at java.lang.reflect.Method.invokeNative(Native Method)
08-16 14:52:06.374: E/TiApplication(9450): at java.lang.reflect.Method.invoke(Method.java:511)
08-16 14:52:06.374: E/TiApplication(9450): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-16 14:52:06.374: E/TiApplication(9450): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-16 14:52:06.374: E/TiApplication(9450): at dalvik.system.NativeStart.main(Native Method)
08-16 14:52:06.424: E/AndroidRuntime(9450): FATAL EXCEPTION: main
08-16 14:52:06.424: E/AndroidRuntime(9450): java.lang.NullPointerException
08-16 14:52:06.424: E/AndroidRuntime(9450): at java.util.HashMap.<init>(HashMap.java:195)
08-16 14:52:06.424: E/AndroidRuntime(9450): at org.appcelerator.kroll.KrollDict.<init>(KrollDict.java:72)
08-16 14:52:06.424: E/AndroidRuntime(9450): at ti.modules.titanium.ui.TableViewProxy.fireEvent(TableViewProxy.java:189)
08-16 14:52:06.424: E/AndroidRuntime(9450): at ti.modules.titanium.ui.widget.tableview.TiTableView.onLayout(TiTableView.java:544)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.424: E/AndroidRuntime(9450): at org.appcelerator.titanium.view.TiCompositeLayout.onLayout(TiCompositeLayout.java:585)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1649)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1507)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.widget.LinearLayout.onLayout(LinearLayout.java:1420)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.View.layout(View.java:13754)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewGroup.layout(ViewGroup.java:4362)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:1866)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1687)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:998)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:4212)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.Choreographer.doCallbacks(Choreographer.java:555)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.Choreographer.doFrame(Choreographer.java:525)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.os.Handler.handleCallback(Handler.java:615)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.os.Handler.dispatchMessage(Handler.java:92)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.os.Looper.loop(Looper.java:137)
08-16 14:52:06.424: E/AndroidRuntime(9450): at android.app.ActivityThread.main(ActivityThread.java:4745)
08-16 14:52:06.424: E/AndroidRuntime(9450): at java.lang.reflect.Method.invokeNative(Native Method)
08-16 14:52:06.424: E/AndroidRuntime(9450): at java.lang.reflect.Method.invoke(Method.java:511)
08-16 14:52:06.424: E/AndroidRuntime(9450): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-16 14:52:06.424: E/AndroidRuntime(9450): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-16 14:52:06.424: E/AndroidRuntime(9450): at dalvik.system.NativeStart.main(Native Method)
Actual:
The app crashes
Expected:
App should not crash
Closing as fixed. Tested and verified on: Titanium Studio, build: 2.1.2.201208201549 Titanium SDK, build: 2.2.0.v20120824175712 Devices: Nexus S (4.1.1), HTC Evo (4.0.3) The app does not crash.
The app still crashes. Tested with Titanium Studio:2.1.2.201208301612 Tested with Titanium SDK: 2.2.0.v20120831200114. Also tested with: Titanium Studio:2.1.2.201208301612 Titanium SDK: 2.2.0.v20120824175712 where in the bug was fixed
It appears that the original fix for this: https://github.com/appcelerator/titanium_mobile/pull/2775 was overwritten by https://github.com/appcelerator/titanium_mobile/pull/2792 - probably a merge issue. I will resend the fix in a new PR. This bug should NOT be happening in 2.1.2 though.
Closed and verified with: Titanium Studio:2.1.3.201209071738 Titanium SDK: 2.2.0.v20120907162025
Anvil testcase PR https://github.com/appcelerator/titanium_mobile/pull/5003