Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3587] Android - Ti.UI.Label crash with html property

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2016-05-11T18:07:09.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAlloy, Titanium SDK & CLI
Labelsandroid, html, label
ReporterAnna
AssigneeShak Hossain
Created2016-05-03T08:07:54.000+0000
Updated2016-05-16T07:45:20.000+0000

Description

On Android, if I use the html property in a Label, when I do scroll this error appear:
[ERROR] :  InputEventReceiver: Exception dispatching input event.
[ERROR] :  E/MessageQueue-JNI: Exception in MessageQueue callback: handleReceiveCallback
[ERROR] :  E/MessageQueue-JNI: java.lang.NullPointerException
[ERROR] :  E/MessageQueue-JNI: 	at ti.modules.titanium.ui.widget.TiUILabel$1.onTouchEvent(TiUILabel.java:105)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.View.dispatchTouchEvent(View.java:8132)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2121)
[ERROR] :  E/MessageQueue-JNI: 	at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2292)
[ERROR] :  E/MessageQueue-JNI: 	at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1622)
[ERROR] :  E/MessageQueue-JNI: 	at android.app.Activity.dispatchTouchEvent(Activity.java:2543)
[ERROR] :  E/MessageQueue-JNI: 	at android.support.v7.internal.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60)
[ERROR] :  E/MessageQueue-JNI: 	at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2240)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.View.dispatchPointerEvent(View.java:8340)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4612)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4478)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4036)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4090)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.forward(ViewR
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4170)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4067)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4227)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4036)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4090)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4059)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4067)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4036)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6328)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6277)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6248)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6213)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6408)
[ERROR] :  E/MessageQueue-JNI: 	at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185
This is the line that causes the crash:
textoLbl.html = args.destacados;
if I put this all works ok (but the html tags aren't parsed)
textoLbl.text = args.destacados;
This only happens when I do scroll. *TEST CASE:* index.xml
<Label id="tituloLbl"></Label>
index.js
textoLbl.html = "<p>El presente curso reúne tanto aspecto de gestión</br>del desempeño del trabajo como aspectos de gestión</p>";

Comments

  1. Nazmus Salahin 2016-05-03

    Hello, Thanks for reporting. Please share with us simple test code that reproduces this issue. When we are able to reproduce this issue we will be able to identify that if it is valid bug or not. Thanks in advance
  2. Anna 2016-05-03

    The test code is above, I've already updated the description.
  3. Sharif AbuDarda 2016-05-03

    Hello, The issue is with your code. You are setting html property to "textoLbl" but your label id you defined as "tituloLbl". I tested the issue in my environment. There was no error using html property to label Regards, Sharif.
  4. Nazmus Salahin 2016-05-04

    Hello, I am also able to run the app with given code without any error when I fix the label id. [Screenshot](https://i.imgsafe.org/89ac696.png) *index.xml:*
       <Alloy>
       	<Window class="container">
       		<Label id="label" onClick="doClick">Hello, World</Label>
       		<Label id="textoLbl"></Label>
       	</Window>
       </Alloy>
       
    *index.js:*
       function doClick(e) {
           alert($.label.text);
       }
       
       $.textoLbl.html = "<p>El presente curso reúne tanto aspecto de gestión</br>del desempeño del trabajo como aspectos de gestión</p>";
       
       $.index.open();
       
    Thanks *Environment*: *Device info:* HTC One (Android 4.4.3) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.2.GA and 5.2.1.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0
  5. Anna 2016-05-04

    Sorry but it was an error copying here the code. I have a textoLbl and a tituloLbl and I copy here the wrong line. Sorry, I still having the problem....
  6. Nazmus Salahin 2016-05-10

    Hello [~amurcia], As we are not able to reproduce this issue with our test code please provide your full test code and steps to reproduce. We will recognize this as bug when we are able to reproduce the issue. Thanks in advance
  7. Anna 2016-05-16

    It's easy to reproduce, put a Label with a html property and click in the label. It crashes always, if you put touchEnabled=false too.

JSON Source