Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24872] [Android] Unable to destroy activity when exiting application has a TableView

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-08-03T16:10:24.000+0000
Affected Version/sRelease 6.1.0
Fix Version/sRelease 6.1.2
ComponentsAndroid
Labelsreprod
ReporterSamir Mohammed
AssigneeEric Merriman
Created2017-06-21T22:00:05.000+0000
Updated2017-08-03T16:10:31.000+0000

Description

When Pressing the back button on an android application, the application crashes and displays the following error message:
[ERROR] :  TiApplication: (main) [353,2796] Sending event: exception on thread: main msg:java.lang.RuntimeException: Unable to destroy activity {com.appc.test1/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(java.lang.String, java.lang.Object, boolean)' on a null object reference; Titanium 6.1.1,2017/06/19 14:33,undefined
[ERROR] :  TiApplication: java.lang.RuntimeException: Unable to destroy activity {com.appc.test1/org.appcelerator.titanium.TiActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(java.lang.String, java.lang.Object, boolean)' on a null object reference
[ERROR] :  TiApplication: 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4203)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4221)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.-wrap6(ActivityThread.java)
[ERROR] :  TiApplication: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1538)
[ERROR] :  TiApplication: 	at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] :  TiApplication: 	at android.os.Looper.loop(Looper.java:154)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.main(ActivityThread.java:6119)
[ERROR] :  TiApplication: 	at java.lang.reflect.Method.invoke(Native Method)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
[ERROR] :  TiApplication: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
[ERROR] :  TiApplication: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.titanium.proxy.TiViewProxy.fireEvent(java.lang.String, java.lang.Object, boolean)' on a null object reference
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.view.TiUIView.fireEvent(TiUIView.java:1940)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.view.TiUIView.fireEvent(TiUIView.java:1931)
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.widget.TiUIImageView.fireStop(TiUIImageView.java:509)
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.widget.TiUIImageView.handleStop(TiUIImageView.java:664)
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.widget.TiUIImageView.release(TiUIImageView.java:993)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.proxy.TiViewProxy.releaseViews(TiViewProxy.java:543)
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.TableViewRowProxy.releaseViews(TableViewRowProxy.java:280)
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.TableViewSectionProxy.releaseViews(TableViewSectionProxy.java:147)
[ERROR] :  TiApplication: 	at ti.modules.titanium.ui.TableViewProxy.releaseViews(TableViewProxy.java:133)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.proxy.TiViewProxy.releaseViews(TiViewProxy.java:540)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.proxy.TiWindowProxy.closeFromActivity(TiWindowProxy.java:191)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiBaseActivity.onDestroy(TiBaseActivity.java:1579)
[ERROR] :  TiApplication: 	at org.appcelerator.titanium.TiActivity.onDestroy(TiActivity.java:32)
[ERROR] :  TiApplication: 	at android.app.Activity.performDestroy(Activity.java:6881)
[ERROR] :  TiApplication: 	at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1153)
[ERROR] :  TiApplication: 	at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4190)
[ERROR] :  TiApplication: 	... 9 more
*Steps to reproduce* 1. Create a new app. 2. Replace the contents of the app's app.js with the code below. 3. Run the app.
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({  
    title:'Test',
    backgroundColor:'gray',
	exitOnClose: true
});
 
var rows = [];
for (var i = 0; i < 30; i++) {
	var row = Ti.UI.createTableViewRow({height: "40dp"});
	var iv = Ti.UI.createImageView({image: "/KS_nav_ui.png", height: "43"});
	row.add(iv);
	rows.push(row);
}
 
var tv = Ti.UI.createTableView({data: rows});
win.add(tv);
win.open();

Attachments

FileDateSize
KS_nav_ui.png2017-06-21T21:39:53.000+00001158

Comments

  1. Vittorio Sorbera 2017-07-05

    I've the same issue using Ti SDK 6.1.1.GA
  2. Lee Morris 2017-07-12

    I am able to reproduce this issue with the following environment; Pixel (7.1) Studio 4.9.0.201705302345 Ti SDK 6.1.1 GA Appc NPM 4.2.9 Appc CLI 6.2.2 Ti CLI 5.0.14 Alloy 1.9.11 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131
  3. Vittorio Sorbera 2017-07-13

  4. AppDev 2017-07-20

    This issue is affecting us as well on Ti SDK 6.1.1.GA only on a window that contains a TableView. Other windows seem to be fine still. The same code works on Ti SDK 5.5.1.GA. Is there any workaround while we wait for a fix and the following release of Ti SDK?
  5. Gary Mathews 2017-08-03

    This issue has been fixed in 6.1.2 by TIMOB-24926

JSON Source