Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15567] Android: Alloy ListView app crash on startup

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2013-10-24T17:42:24.000+0000
Affected Version/sRelease 3.1.3
Fix Version/s2013 Sprint 22, 2013 Sprint 22 API, Release 3.2.0
ComponentsAndroid
LabelsAlloy, module_listview, triage
ReporterMatt Langston
AssigneeHieu Pham
Created2013-10-23T16:53:59.000+0000
Updated2013-10-24T17:57:31.000+0000

Description

Our partner Alfresco discovered this issue when trying to build their Alfresco SDK test harness for Android, using SDK 3.1.3. This is stopping them progressing with the Android version. The issue is in the ListViews in the AlfrescoTestHarness Alloy project. These work fine for iOS, but cause an exception on Android. I have attached the source zip to this ticket, and this is the exception that occurs, during app start up (before any of our code is called):
[ERROR][TiApplication(  478)] (main) [8065,10751] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.1.3,2013/09/18 12:01,222f4d1
[ERROR][TiApplication(  478)] java.lang.NullPointerException
[ERROR][TiApplication(  478)]     at ti.modules.titanium.ui.widget.listview.ListSectionProxy.handleMessage(ListSectionProxy.java:157)
[ERROR][TiApplication(  478)]     at android.os.Handler.dispatchMessage(Handler.java:95)
[ERROR][TiApplication(  478)]     at android.os.Looper.loop(Looper.java:130)
[ERROR][TiApplication(  478)]     at android.app.ActivityThread.main(ActivityThread.java:3683)
[ERROR][TiApplication(  478)]     at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR][TiApplication(  478)]     at java.lang.reflect.Method.invoke(Method.java:507)
[ERROR][TiApplication(  478)]     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
[ERROR][TiApplication(  478)]     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
[ERROR][TiApplication(  478)]     at dalvik.system.NativeStart.main(Native Method)
[ERROR][AndroidRuntime(  478)] FATAL EXCEPTION: main
[ERROR][AndroidRuntime(  478)] java.lang.NullPointerException
[ERROR][AndroidRuntime(  478)]     at ti.modules.titanium.ui.widget.listview.ListSectionProxy.handleMessage(ListSectionProxy.java:157)
[ERROR][AndroidRuntime(  478)]     at android.os.Handler.dispatchMessage(Handler.java:95)
[ERROR][AndroidRuntime(  478)]     at android.os.Looper.loop(Looper.java:130)
[ERROR][AndroidRuntime(  478)]     at android.app.ActivityThread.main(ActivityThread.java:3683)
[ERROR][AndroidRuntime(  478)]     at java.lang.reflect.Method.invokeNative(Native Method)
[ERROR][AndroidRuntime(  478)]     at java.lang.reflect.Method.invoke(Method.java:507)
[ERROR][AndroidRuntime(  478)]     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
[ERROR][AndroidRuntime(  478)]     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
[ERROR][AndroidRuntime(  478)]     at dalvik.system.NativeStart.main(Native Method)

Comments

  1. Hieu Pham 2013-10-23

    I couldn't reproduce the crash running AlfrescoTestHarness. I do see a login screen with credentials pop up. Here's another test case that will produce the same crash on start up:
       var sections = [];
       var animalsSection = Ti.UI.createListSection({ headerTitle: 'Animals'});
       	var animalsDataSet = [
       	    {properties: { title: 'Deer', searchableText:'Animals Deer', itemId:'3 0'}},
       	    {properties: { title: 'Dog', searchableText:'Animals Dog', itemId:'3 1'}},
       	    {properties: { title: 'Cat', searchableText:'Animals Cat', itemId:'3 2'}},
       	    {properties: { title: 'Elephant', searchableText:'Animals Elephant', itemId:'3 3'}},
       	];
       	animalsSection.getItems();
       	animalsSection.setItems(animalsDataSet);
       	sections.push(animalsSection);
       	var listView = Ti.UI.createListView({top: 250});
       	listView.sections = sections;
       	
       	var win = Ti.UI.createWindow();
       	win.add(listView);
       	win.open();
       
  2. Hieu Pham 2013-10-23

  3. Federico Casali 2013-10-24

    Verified fixed. TiSDK 3.2.0.v20131023160426 CLI 3.2.0 Titanium Studio 3.2.0.201310230548 Closing.
  4. Matt Langston 2013-10-24

    Remove Alfresco SDK attachment.
  5. Hieu Pham 2013-10-24

    master PR: https://github.com/appcelerator/titanium_mobile/pull/4829

JSON Source