lottie-ios icon indicating copy to clipboard operation
lottie-ios copied to clipboard

Storyboard referencing `AnimationView` causes crash in Lottie 3.5.0

Open brian-voong opened this issue 2 years ago • 10 comments

Which Version of Lottie are you using?

Lottie 3.5.0

The following crashes are showing up in 3.5.0 after updating from 3.4.4:

image

Reverting back to 3.4.4, these crashes go away.

brian-voong avatar Oct 13 '22 17:10 brian-voong

Could you share a sample project that reproduces this issue? Also more details about the crash (a stack trace and the error message) would be helpful.

calda avatar Oct 13 '22 17:10 calda

Currently not able to repro this with a brand new project, I'll take another stab at it once I get some free cycles again.

brian-voong avatar Oct 13 '22 17:10 brian-voong

If you can share more info about the crash (especially the error message and stack trace) we may be able to add a defensive fix even without a repro case

calda avatar Oct 13 '22 18:10 calda

Bad Access:

image

The stack trace isn't that helpful so I've left it out. We're using a combination of Storyboard and UIKit here in some legacy code to render this animation. This issue might go away if we rewrote it using SwiftUI. Nonetheless its a crash that's new to 3.5.0.

brian-voong avatar Oct 13 '22 18:10 brian-voong

I will work on getting more info from my development team but I can second the new crashes we are seeing after upgrading to 3.5.0.

zypherman avatar Oct 13 '22 20:10 zypherman

The same issue, after updating to version 3.5.0

SajjadN92 avatar Oct 14 '22 07:10 SajjadN92

Same issue here! Seems to be caused by:

a) having AnimationView referenced a storyboard b) using LottieAnimation.named(: to initialise an AnimationView's animation, or initialising an LottieAnimationView's animation view Animation.named(:

We've updated all references to either AnimationView or Animation.named across the whole project to their newer counterparts and it seems to have resolved all crashes for now if it helps!

Screenshot 2022-10-14 at 14 35 40

alextudge avatar Oct 14 '22 13:10 alextudge

Ohhh, interesting! It sounds like changing AnimationView from a class to a typealias is source-compatible for existing Swift code but not for existing storyboards. Thanks for the info.

I don't think there's a fix for this on our side -- storyboards will just need to he updated to use LottieAnimationView instead of AnimationView. We're removing the old AnimationView declaration completely in Lottie 4.0 this month, which will hopefully change this cryptic error into something easier to understand (e.g. "no type named AnimationView").

calda avatar Oct 14 '22 15:10 calda

I'll keep this issue open until we release Lottie 4.0, for visibility.

calda avatar Oct 14 '22 15:10 calda

Ohhh, interesting! It sounds like changing AnimationView from a class to a typealias is source-compatible for existing Swift code but not for existing storyboards. Thanks for the info.

I don't think there's a fix for this on our side -- storyboards will just need to he updated to use LottieAnimationView instead of AnimationView. We're removing the old AnimationView declaration completely in Lottie 4.0 this month, which will hopefully change this cryptic error into something easier to understand (e.g. "no type named AnimationView").

I can confirm changing the element in our Storyboard from AnimationView to LottieAnimationView is no longer crashing for 3.5.0

brian-voong avatar Oct 14 '22 15:10 brian-voong

We removed the AnimationView typealias in Lottie 4.0 (that type was renamed to LottieAnimationView in Lottie 3.5.0), so I assume this specific issue no longer happens. Thanks all for the report.

calda avatar Dec 06 '22 23:12 calda