[TIMOB-24872] [Android] Unable to destroy activity when exiting application has a TableView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-08-03T16:10:24.000+0000 |
Affected Version/s | Release 6.1.0 |
Fix Version/s | Release 6.1.2 |
Components | Android |
Labels | reprod |
Reporter | Samir Mohammed |
Assignee | Eric Merriman |
Created | 2017-06-21T22:00:05.000+0000 |
Updated | 2017-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
File | Date | Size |
---|---|---|
KS_nav_ui.png | 2017-06-21T21:39:53.000+0000 | 1158 |
I've the same issue using Ti SDK 6.1.1.GA
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
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?
This issue has been fixed in
6.1.2
by TIMOB-24926