Nativescript: Calling js method onTransitionEnd failed TypeError Error

Created on 27 Apr 2018  路  23Comments  路  Source: NativeScript/NativeScript

Exception com.tns.NativeScriptException: Calling js method onTransitionEnd failed TypeError: Cannot read property 'delete' of undefined File: "file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js, line: 552, column: 11 StackTrace: Frame: function:'transitionOrAnimationCompleted', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 552, column: 12 Frame: function:'TransitionListenerImpl.onTransitionEnd', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 219, column: 17
com.tns.Runtime.callJSMethodNative (Runtime.java)
com.tns.Runtime.dispatchCallJSMethodNative (Runtime.java:1088)
com.tns.Runtime.callJSMethodImpl (Runtime.java:970)
com.tns.Runtime.callJSMethod (Runtime.java:957)
com.tns.Runtime.callJSMethod (Runtime.java:941)
com.tns.Runtime.callJSMethod (Runtime.java:933)
com.tns.gen.java.lang.Object_transitions_202_36_TransitionListenerImpl.onTransitionEnd (Object_transitions_202_36_TransitionListenerImpl.java:18)
android.transition.Transition.end (Transition.java:1924)
android.transition.Transition$3.onAnimationEnd (Transition.java:1875)
android.animation.ValueAnimator.endAnimation (ValueAnimator.java:1239)
android.animation.ValueAnimator$AnimationHandler.doAnimationFrame (ValueAnimator.java:766)
android.animation.ValueAnimator$AnimationHandler$1.run (ValueAnimator.java:801)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:911)
android.view.Choreographer.doCallbacks (Choreographer.java:686)
android.view.Choreographer.doFrame (Choreographer.java:619)
android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:897)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:7325)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

needs more info android

Most helpful comment

The fix is now live with the latest version of tns-core-modules

All 23 comments

Hi @shivgolani,
We checked the attached log, however, this information is not enough to investigate the problem further. Please follow the template and provide the required info. Also, it will help if you provide sample project, which could be used for debugging.

Template->

Dear friend, we, the rest of the NativeScript community really
appreciate your feedback! While we are doing all we can to take care of every
issue, sometimes we get overwhelmed. Because of that, we will consider issues
that are not constructive or problems that cannot be reproduced "dead".
Additionally, we will treat feature requests or bug reports with unanswered
questions regarding the behavior/reproduction for more than 20 days "dead". All
"dead" issues will get closed.

## Please, provide the details below:

### Did you verify this is a real problem by searching the [NativeScript Forum](http://forum.nativescript.org) and the [other open issues in this repo](https://github.com/NativeScript/nativescript/issues)?

### Tell us about the problem
Please, ensure your title is less than 63 characters long and starts with a capital
letter.

### Which platform(s) does your issue occur on?
iOS/Android/Both

### Please provide the following version numbers that your issue occurs with:
- CLI: (run `tns --version` to fetch it)
- Cross-platform modules: (check the 'version' attribute in the
`node_modules/tns-core-modules/package.json` file in your project)
- Runtime(s): (look for the `"tns-android"` and `"tns-ios"` properties in the
`package.json` file of your project)
- Plugin(s): (look for the version number in the `package.json` file of your
project)

### Please tell us how to recreate the issue in as much detail as possible.
The best approach would be to get your code running in the [NativeScript Playground](https://play.nativescript.org) and share the link with us, along with any additional details or steps to reproduce needed for examining the issue there. 

### Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.


Did you verify this is a real problem by searching the NativeScript Forum and the other open issues in this repo?

Yes.

Tell us about the problem

Please, ensure your title is less than 63 characters long and starts with a capital
letter.

The issue occurs during navigation from one page to other using
frame.topmost().navigate({
animated:true,
moduleName: path
});

Exception com.tns.NativeScriptException: Calling js method onTransitionEnd failed TypeError: Cannot read property 'delete' of undefined File: "file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js, line: 552, column: 11 StackTrace: Frame: function:'transitionOrAnimationCompleted', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 552, column: 12 Frame: function:'TransitionListenerImpl.onTransitionEnd', file:'file:///data/data/com.ngasce.jforce/files/app/tns_modules/tns-core-modules/ui/frame/fragment.transitions.js', line: 219, column: 17
com.tns.Runtime.callJSMethodNative (Runtime.java)
com.tns.Runtime.dispatchCallJSMethodNative (Runtime.java:1088)
com.tns.Runtime.callJSMethodImpl (Runtime.java:970)
com.tns.Runtime.callJSMethod (Runtime.java:957)
com.tns.Runtime.callJSMethod (Runtime.java:941)
com.tns.Runtime.callJSMethod (Runtime.java:933)
com.tns.gen.java.lang.Object_transitions_202_36_TransitionListenerImpl.onTransitionEnd (Object_transitions_202_36_TransitionListenerImpl.java:18)
android.transition.Transition.end (Transition.java:1924)
android.transition.Transition$3.onAnimationEnd (Transition.java:1875)
android.animation.ValueAnimator.endAnimation (ValueAnimator.java:1239)
android.animation.ValueAnimator$AnimationHandler.doAnimationFrame (ValueAnimator.java:766)
android.animation.ValueAnimator$AnimationHandler$1.run (ValueAnimator.java:801)
android.view.Choreographer$CallbackRecord.run (Choreographer.java:911)
android.view.Choreographer.doCallbacks (Choreographer.java:686)
android.view.Choreographer.doFrame (Choreographer.java:619)
android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:897)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:7325)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it)
    4.0.0-2018-04-05-11381
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)
    4.0.0-2018-04-26-03
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the
    package.json file of your project)
    4.0.1
  • Plugin(s): (look for the version number in the package.json file of your
    project)

Please tell us how to recreate the issue in as much detail as possible.

The best approach would be to get your code running in the NativeScript Playground and share the link with us, along with any additional details or steps to reproduce needed for examining the issue there.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

frame.topmost().navigate({
animated:true,
moduleName: path
});

HI @shivgolani,
I tested your scenario in a sample project, however, the navigation seems to work as expected. For your convenience, I am attaching the test project.
Please review it and make the needed changes, which will allow us to reproduce the problem.
Archive.zip

Hi @tsonevn the issue is occurring sometimes but not often. I'm using firebase Crashlytics, this issue has occurred over 200 times.

Hi @shivgolani,
We have tested your scenario again while using navigation with a transition and enabled animation, however, we are still unable to recreate the problem. Without stable steps to reproduce it, we can not confirm that this is an issue in NativeScript.

I would suggest reviewing the sample app, which I attached to my previous comment. In the sample implement the navigation functionality, how it is done in your app. Also, you can apply any further changes, which might be related to the crash or with the navigation at all. If the problem is reproducible, please attached it to the issue.

This is happening when app is put in Background and then started again, and tap to navigate to some page without transition then this error is called.

@markomiljkovic will adding transition on each navigation resolve the issue?

yes it dit in my case :)
but it will work if you have android runtime : 4.0.0
in 4.0.1 there is other bug when navigating fast trough pages

@markomiljkovic Thanks for the quick response. I've added transition on all navigation tap, Although I'm using 4.0.1. Waiting for firebase Crashlytics reports.

I Confirm the same bug on Android when navigating after app is put in Background.

@markomiljkovic do you reproduce the error every time or does it happen intermittently?

@manoldonev it is happening almost everytime :)
I have also created issue 5780

Will check the playground project, thanks!

@ all -- we are discussing this in #5780 as well but I still cannot reproduce the error with the provided Playground project there. So if anyone has another repro that demonstrates the problem reliably -- feel free to chime in.

The fix is in the master branch and will be included in our next official release. Meanwhile, you can test the fix by installing the next version of tns-core-modules

npm uninstall tns-core-modules
npm i tns-core-modules@next --save

+1

+1

+1 after updating with latest module, we still facing same issue.

+1

+1 It reproducible when navigation fast between pages, but crash when opening the app from background is fixed for me

Add following lines to fix app crashing issue.

file Path: node_modules/tns-core-modules/ui/frame/fragment.transitions.android.js
Line: 552.
Method name: transitionOrAnimationCompleted
```
if(!entries){
return;
}
````

The fix is now live with the latest version of tns-core-modules

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.

Was this page helpful?
0 / 5 - 0 ratings