Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-10477

Android: The app crashes on launch on Android

    Details

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hpham Hieu Pham
                Reporter:
                tsmolich Tamila Smolich
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-5753
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code