You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Error (native) com.tns.NativeScriptException: No weak reference found. Attempt to use cleared object reference id=-732891536 #720
Did you verify this is a real problem by searching [Stack Overflow]
Several closed issues like this; none remain open.
Tell us about the problem
I am getting this via a crash recorder:
Error: The application crashed because of an uncaught exception. You can look at "stackTrace" or "nativeException" for more detailed information about the exception. Error: The application crashed because of an uncaught exception. You can look at "stackTrace" or "nativeException" for more detailed information about the exception.\n at Error (native) com.tns.NativeScriptException: No weak reference found. Attempt to use cleared object reference id=-732891536"
Please provide the following version numbers that your issue occurs with:
Android Runtime: 2.4.1
Core Modules: 2.4.4
No Snapshot (Snapshot was disabled do to issues)
Release Mode
Please tell us how to recreate the issue in as much detail as possible.
I am unable to duplicate it in house; but I see one of these error messages in my log at least twice a week for the last couple months.
If you have some way to determine what that object id is at crash time; that would be great to be able to see what is being cleaned up and removed improperly.
@NathanaelA truth is there's no easy way of tracking this issue down:
we can't figure out how to reproduce it and that's normal because,
it's connected to the way we do garbage collection
It's a very unpleasant issue, I know, but until we find a way to reproduce it, we can only do blind fixes, and as we all know, that wont be as effective as debugging and figuring out what's wrong.
Any idea how we can track this down;
Well __enableVerboseLogging() and send us the logcat of the crash, this way, we'll be able to see, at least, the id of the problematic object and it would be some kind of a start.
Recently opened up an app for coworkers to test and one of them reported the following runtime error on android. This is with tns --verision = 4.0.0-2018-03-30-11339. Also for this release I have the following settings, I was curious if markingMode has something to do with this - sometime ago I had set it to none to greatly app boost performance.
An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException: No weak reference found. Attempt to use cleared object reference id=26391
at com.tns.Runtime.getJavaObjectByID(Runtime.java:892)
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1088)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:970)
at com.tns.Runtime.callJSMethod(Runtime.java:957)
at com.tns.Runtime.callJSMethod(Runtime.java:941)
at com.tns.Runtime.callJSMethod(Runtime.java:933)
at com.tns.gen.android.app.DialogFragment_frnal_ts_helpers_l58_c38__DialogFragmentImpl.onCreateView(DialogFragment_frnal_ts_helpers_l58_c38__DialogFragmentImpl.java:20)
at android.app.Fragment.performCreateView(Fragment.java:2353)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:995)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1171)
at android.app.BackStackRecord.run(BackStackRecord.java:816)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1580)
at android.app.FragmentManagerImpl$1.run(FragmentManager.java:483)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6196)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)
Activity
petekanev commentedon Mar 7, 2017
Related to #466
NathanaelA commentedon Mar 7, 2017
Plamen5kov commentedon Mar 7, 2017
@NathanaelA truth is there's no easy way of tracking this issue down:
It's a very unpleasant issue, I know, but until we find a way to reproduce it, we can only do blind fixes, and as we all know, that wont be as effective as debugging and figuring out what's wrong.
Well
__enableVerboseLogging()and send us the logcat of the crash, this way, we'll be able to see, at least, the id of the problematic object and it would be some kind of a start.NathanaelA commentedon Mar 7, 2017
Plamen5kov commentedon Mar 7, 2017
It's a great idea, we can do a logcat dump to file when an application crash, which can later be handled as you said.
nirsalon commentedon Mar 9, 2017
Just happened here on release mode as well:
tns-android: 2.4.1
tns-core-modules: 2.4.4
API Level 23
Phone: XT1580
Exception com.tns.NativeScriptException: No weak reference found. Attempt to use cleared object reference id=1057 com.tns.Runtime.getJavaObjectByID (Runtime.java:971) com.tns.Runtime.callJSMethodNative (Runtime.java) com.tns.Runtime.dispatchCallJSMethodNative (Runtime.java:1197) com.tns.Runtime.callJSMethodImpl (Runtime.java:1061) com.tns.Runtime.callJSMethod (Runtime.java:1047) com.tns.Runtime.callJSMethod (Runtime.java:1028) com.tns.Runtime.callJSMethod (Runtime.java:1018) com.tns.gen.android.view.View_OnTouchListener.onTouch (android.view.View$OnTouchListener.java) android.view.View.dispatchTouchEvent (View.java:9293) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2549) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2240) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) android.view.ViewGroup.dispatchTransformedTouchEvent (ViewGroup.java:2555) android.view.ViewGroup.dispatchTouchEvent (ViewGroup.java:2254) com.android.internal.policy.PhoneWindow$DecorView.superDispatchTouchEvent (PhoneWindow.java:2403) com.android.internal.policy.PhoneWindow.superDispatchTouchEvent (PhoneWindow.java:1737) android.app.Activity.dispatchTouchEvent (Activity.java:2769) com.appsee.f.dispatchTouchEvent (e:625) com.android.internal.policy.PhoneWindow$DecorView.dispatchTouchEvent (PhoneWindow.java:2364) android.view.View.dispatchPointerEvent (View.java:9517) android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent (ViewRootImpl.java:4242) android.view.ViewRootImpl$ViewPostImeInputStage.onProcess (ViewRootImpl.java:4108) android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:3654) android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:3707) android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:3673) android.view.ViewRootImpl$AsyncInputStage.forward (ViewRootImpl.java:3799) android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:3681) android.view.ViewRootImpl$AsyncInputStage.apply (ViewRootImpl.java:3856) android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:3654) android.view.ViewRootImpl$InputStage.onDeliverToNext (ViewRootImpl.java:3707) android.view.ViewRootImpl$InputStage.forward (ViewRootImpl.java:3673) android.view.ViewRootImpl$InputStage.apply (ViewRootImpl.java:3681) android.view.ViewRootImpl$InputStage.deliver (ViewRootImpl.java:3654) android.view.ViewRootImpl.deliverInputEvent (ViewRootImpl.java:5969) android.view.ViewRootImpl.doProcessInputEvents (ViewRootImpl.java:5908) android.view.ViewRootImpl.enqueueInputEvent (ViewRootImpl.java:5869) android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent (ViewRootImpl.java:6072) android.view.InputEventReceiver.dispatchInputEvent (InputEventReceiver.java:192) android.os.MessageQueue.nativePollOnce (MessageQueue.java) android.os.MessageQueue.next (MessageQueue.java:323) android.os.Looper.loop (Looper.java:135) android.app.ActivityThread.main (ActivityThread.java:5443) java.lang.reflect.Method.invoke (Method.java)NathanaelA commentedon Mar 17, 2017
Plamen5kov commentedon Mar 20, 2017
@NathanaelA we'll consider it, thank you for your feedback.
SBD580 commentedon Mar 23, 2017
+1 same thing here
Plamen5kov commentedon Mar 23, 2017
@SBD580 do you by any chance have steps to reproduce?
SBD580 commentedon Mar 23, 2017
I'm afraid not
NathanaelA commentedon Mar 26, 2017
Plamen5kov commentedon Mar 27, 2017
@NathanaelA, thank you, that's useful information to me.
Merge pull request #744 from NativeScript/pete/fix-gc-issue-no-weakref
petekanev commentedon Apr 24, 2017
@NathanaelA @SBD580 PR Merged. The fix will be available in release 3.0.0
jeffswitzer commentedon Apr 23, 2018
Recently opened up an app for coworkers to test and one of them reported the following runtime error on android. This is with tns --verision = 4.0.0-2018-03-30-11339. Also for this release I have the following settings, I was curious if markingMode has something to do with this - sometime ago I had set it to none to greatly app boost performance.