Skip to content

Complete app crash when tapping around a Textfield at times #1405

Closed

Description

@prawnsalad
com.tns.NativeScriptException: 
Calling js method afterTextChanged failed

Error: com.tns.NativeScriptException: No weak reference found. Attempt to use cleared object reference id=10709
    com.tns.Platform.getJavaObjectByID(Platform.java:623)
    com.tns.Platform.callJSMethodNative(Native Method)
    com.tns.Platform.dispatchCallJSMethodNative(Platform.java:799)
    com.tns.Platform.callJSMethod(Platform.java:700)
    com.tns.Platform.callJSMethod(Platform.java:680)
    com.tns.Platform.callJSMethod(Platform.java:670)
    com.tns.gen.android.text.TextWatcher_ftns_modules_ui_editable-text-base_editable-text-base_l22_c27__.afterTextChanged(android.text.TextWatcher.java)
    android.widget.TextView.sendAfterTextChanged(TextView.java:8004)
    android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:10165)
    android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:1043)
    android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:560)
    android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:492)
    android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:491)
    android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:685)
    android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:197)
    com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:184)
    com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:286)
    com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
    android.os.Handler.dispatchMessage(Handler.java:102)
    android.os.Looper.loop(Looper.java:148)
    android.app.ActivityThread.main(ActivityThread.java:5417)
    java.lang.reflect.Method.invoke(Native Method)
    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
    com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
File: "/data/data/com.darrenwhitlen.ircmobile/files/app/tns_modules/ui/editable-text-base/editable-text-base.js, line: 46, column: 100

StackTrace: 
Frame: function:'android.text.TextWatcher.afterTextChanged', file:'/data/data/com.darrenwhitlen.ircmobile/files/app/tns_modules/ui/editable-text-base/editable-text-base.js', line: 46, column: 101

at com.tns.Platform.callJSMethodNative(Native Method)
at com.tns.Platform.dispatchCallJSMethodNative(Platform.java:799)
at com.tns.Platform.callJSMethod(Platform.java:700)
at com.tns.Platform.callJSMethod(Platform.java:680)
at com.tns.Platform.callJSMethod(Platform.java:670)
at com.tns.gen.android.text.TextWatcher_ftns_modules_ui_editable-text-base_editable-text-base_l22_c27__.afterTextChanged(android.text.TextWatcher.java)
at android.widget.TextView.sendAfterTextChanged(TextView.java:8004)
at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:10165)
at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:1043)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:560)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:492)
at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:491)
at android.view.inputmethod.BaseInputConnection.replaceText(BaseInputConnection.java:685)
at android.view.inputmethod.BaseInputConnection.commitText(BaseInputConnection.java:197)
at com.android.internal.widget.EditableInputConnection.commitText(EditableInputConnection.java:184)
at com.android.internal.view.IInputConnectionWrapper.executeMessage(IInputConnectionWrapper.java:286)
at com.android.internal.view.IInputConnectionWrapper$MyHandler.handleMessage(IInputConnectionWrapper.java:78)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Activity

  1. enchev commented on Jan 20, 2016

    @enchev
    Contributor

    Can you post more info about your environment? Is this a device or emulator? What is the API Level?

  2. prawnsalad commented on Jan 20, 2016

    @prawnsalad
    Author

    Testing on a Nexus 5 device, developing against SDK 22. It only happens when I'm not expecting it but it's appearing when I'm tapping around the textfield pretty fast, tapping between the TextField and a Button.

  3. added this to the 1.6.0 milestone on Jan 20, 2016
  4. self-assigned this
    on Jan 20, 2016
  5. prawnsalad commented on Jan 21, 2016

    @prawnsalad
    Author

    Not sure if I should be including anything else, but making these changes on my 1.5.2 install didn't make any difference. Still getting the same error

  6. ofirdagan commented on Feb 20, 2016

    @ofirdagan
    Contributor

    +1

    Happened to me as well (Nexus 5 real device android 6.0.1)

  7. dragGH102 commented on Feb 25, 2016

    @dragGH102

    +1 here, happens very occasionally on Android 5.0 - {n} 1.6.1 when

    frameModule.topmost().navigate(module_name)

    @enchev may this issue be open again? it's quite a severe issue in a production app. thanks :)

  8. Daxito commented on Feb 25, 2016

    @Daxito

    +1
    I also see this error from time to time.

  9. Daxito commented on Mar 7, 2016

    @Daxito

    +1
    Still getting this error over and over, this is my log, maybe this is actually a different error??
    Using {N} 1.6.1

    com.tns.NativeScriptException: No weak reference found. Attempt to use cleared object reference id=10609
    at com.tns.Platform.getJavaObjectByID(Platform.java:633)
    at com.tns.Platform.callJSMethodNative(Native Method)
    at com.tns.Platform.dispatchCallJSMethodNative(Platform.java:812)
    at com.tns.Platform.callJSMethod(Platform.java:711)
    at com.tns.Platform.callJSMethod(Platform.java:690)
    at com.tns.Platform.callJSMethod(Platform.java:680)
    at com.tns.gen.android.text.TextWatcher_ftns_modules_ui_editable-text-base_editable-text-base_l22_c29__.afterTextChanged(android.text.TextWatcher.java)
    at android.widget.TextView.sendAfterTextChanged(TextView.java:8702)
    at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:11001)
    at android.text.SpannableStringBuilder.sendAfterTextChanged(SpannableStringBuilder.java:976)
    at android.text.SpannableStringBuilder.replace(SpannableStringBuilder.java:520)
    at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:216)
    at android.text.SpannableStringBuilder.delete(SpannableStringBuilder.java:33)
    at android.text.method.BaseKeyListener.backspaceOrForwardDelete(BaseKeyListener.java:94)
    at android.text.method.BaseKeyListener.backspace(BaseKeyListener.java:49)
    at android.text.method.BaseKeyListener.onKeyDown(BaseKeyListener.java:155)
    at android.text.method.NumberKeyListener.onKeyDown(NumberKeyListener.java:138)
    at android.widget.TextView.doKeyDown(TextView.java:6675)
    at android.widget.TextView.onKeyDown(TextView.java:6453)
    at android.view.KeyEvent.dispatch(KeyEvent.java:3135)
    at android.view.View.dispatchKeyEvent(View.java:8777)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1680)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1680)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1680)
    at android.widget.ScrollView.dispatchKeyEvent(ScrollView.java:516)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1680)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1680)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1680)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1680)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1680)
    at android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:1680)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchKeyEvent(PhoneWindow.java:2544)
    at com.android.internal.policy.impl.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:1757)
    at android.app.Activity.dispatchKeyEvent(Activity.java:2800)
    at com.tns.NativeScriptActivity.dispatchKeyEvent(NativeScriptActivity.java:331)
    at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2429)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4512)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4467)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4024)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4077)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4043)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4157)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4051)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4214)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4024)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4077)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4043)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4051)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4024)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6485)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6384)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6355)
    at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3588)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:5835)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)

  10. x00 commented on Feb 8, 2017

    @x00

    with me I type a few letters then clear backspace to clear, then backspace twice, then another letter, this causes the error.

  11. x00 commented on Feb 11, 2017

    @x00

    Advice: put some error handling in your methods you will find that actual error that is causing the problem, rather than this failure message.

  12. lock commented on Aug 28, 2019

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  13. locked and limited conversation to collaborators on Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions