-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
App crashes when playing KeyframeAnimation with a View
that is not added to the view yet
#7984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
we see the same error "in the wild" on the App Store on some iPhones (X and XR). This does not always happen for us, though. |
@lambourn Are you by any chance using Angular ? |
@VladimirAmiorkov yes, we do. To give more context: I'm analyzing some crash logs on Crashlytics with the same stack trace error message - as the code is minified I do not see the exact root cause in front of me but it's coming from the play() method
|
@lambourn What kind of animations do you have in your NativeScript Angular app, do you use the Animations that are attached to an Angular Component or you do manual animations by calling the .animate() API of a |
both. But in the specific case where it crashes I think it's due to the fact that at runtime we change the CSS class of a UI element (StackLayout in that case) which in turn calls
and the corresponding CSS Class:
In the end somewhat similar to your sample code gets executed. EDIT: btw, the reason why it crashes on some iOS device I do not know yet. Potentially the underlying view is not ready when the CSS class gets changed. |
@VladimirAmiorkov is this issue related to NativeScript/nativescript-angular#2002? At least the error is the same. |
Yes this issue was caused by a similar approach with the animations that |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
If you create an
View
in the code and you wan to animate it usingKeyframeAnimation
before you have added it to the UI tree the app will crash with the below error.To Reproduce
Run the attached project and press the "Tap" button.
Expected behavior
App to not crash.
Sample project
animate-test.zip
Additional context
The text was updated successfully, but these errors were encountered: