[TIMOB-24262] Android : Crash when Try to remove view from parents.
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-01-12T09:30:18.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 6.1.0 |
Components | Android |
Labels | regression |
Reporter | Dongwoo Gim |
Assignee | Gary Mathews |
Created | 2016-12-23T09:33:33.000+0000 |
Updated | 2017-01-12T17:44:09.000+0000 |
Description
6.1.0.v20161222061413
click event has error, singletap is ok.
Test code
var win = Ti.UI.createWindow({});
var scrollView = Ti.UI.createScrollView({
layout: 'vertical'
});
var view1 = Ti.UI.createView({
backgroundColor:'red', top: 10, height: 200, width: 1000
});
var view2 = Ti.UI.createView({
backgroundColor:'blue', top: 10, height: 200, width: 1000
});
scrollView.add(view1);
scrollView.add(view2);
win.add(scrollView);
win.open();
view1.addEventListener('click', function() {
// error
scrollView.remove(view1);
});
view2.addEventListener('singletap', function() {
// ok
scrollView.remove(view2);
});
Error message
[ERROR] TiApplication: (main) [5747,6000] Sending event: exception on thread: main msg:java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.titanium.proxy.TiViewProxy.hierarchyHasListener(java.lang.String)' on a null object reference; Titanium 6.1.0,2016/12/22 06:14,undefined
[ERROR] TiApplication: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean org.appcelerator.titanium.proxy.TiViewProxy.hierarchyHasListener(java.lang.String)' on a null object reference
[ERROR] TiApplication: at org.appcelerator.titanium.view.TiUIView$7.onSingleTapConfirmed(TiUIView.java:1607)
[ERROR] TiApplication: at android.view.GestureDetector$GestureHandler.handleMessage(GestureDetector.java:300)
[ERROR] TiApplication: at android.os.Handler.dispatchMessage(Handler.java:102)
[ERROR] TiApplication: at android.os.Looper.loop(Looper.java:148)
[ERROR] TiApplication: at android.app.ActivityThread.main(ActivityThread.java:5417)
[ERROR] TiApplication: at java.lang.reflect.Method.invoke(Native Method)
[ERROR] TiApplication: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
[ERROR] TiApplication: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Hello, What is the Android version you are trying on? I just tested your sample code in Android 6.0.1 device with SDK 6.0.1.GA. The app works as expected. Both view was removed successfully. Thanks.
I was wroten. Titanium SDK 6.1.0.v20161222061413. I know GA build is ok.
Hello, Use the GA release for your development. Thanks.
master: https://github.com/appcelerator/titanium_mobile/pull/8726
Verified fixed, Error no longer occurs on the latest build of the SDK. *Environment*