-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Lottie Swift with Xcode 11.2 Crashes when creating AnimationView #1066
Comments
I just noticed this as well. |
I get this crash too with Xcode 11.2. It happens when setting an animation on the animation view, not when creating the animation view. |
Same for me. That happened with Xcode 11.2 beta too |
This crash does not seem related to 13.2. It happens on simulator and devices running 13.2 and 12.4.2. |
It's a compiler issue, right? I can run our prod app with the latest Lottie version when it's built with the 5.1 compiler, but not with the latest compiler. |
Well yeah, if you build with Xcode 11.1 or earlier you're fine. |
Could someone set up a sample project or link me to an animation that is causing this crash? I can't reproduce this on my end. |
I am having the same problem. Anything Lottie on Xcode 11.2 will not run. Here is a link to a repository: https://github.com/rouviere/lottie It does not run on the simulator or on an iPhone running 13.2. I had to go back to Xcode 11.1 where it runs fine on the simulator but will not run on an iPhone running 13.2. |
I just verified this seems to only happen when you include Lottie through SPM. Does this also happen with CocoaPods? I tested the same code with including Lottie files manually vs. using SPM to download the package and it only crashes when using SPM |
I only tried with swift pm. |
We also use SPM. I can go back to CocoaPods and see if it solves the problem. |
I’m using SPM and it crashes. I’ve just tried this with Cocoapods and then it doesn’t crash. |
The issue is related to stripped generic symbols from a SPM package. Try disabling dead code stripping on your app’s project: DEAD_CODE_STRIPPING = NO https://bugs.swift.org/plugins/servlet/mobile#issue/SR-11564 |
Adding with Carthage also works. Lottie doesn't crash |
Hey everyone! Im looking into this issue and working to see if it can be fixed code side. For now use the solution provided by @ydnar above. |
An update, theres a swift bug filed here for the same issue on another repo. Please add your comments there so we can get a quick fix from apple! |
I can confirm that disabling dead code stripping works. However, I don’t know if this causes any side-effects. |
i have disable dead code stripping code and still crashing in this line when try to load xib files with lottie Animated View: |
If you press enter in the textfield where the storyboard refers AnimationView, does it resolve to being defined in Lottie? |
Confirmed that yndar's solution works. |
Was this related to the 11.2 issue that lead to Apple pulling that version? If so, it should fixed as of 11.2.1. Can someone who was running into this issue confirm whether it's still happening in 11.2.1? |
Sadly, you still need to disable dead code stripping in 11.2.1. |
11.2.1 still encountering this crash |
Switching from SPM back to Cocoapods worked for me. |
Yes, CocoaPods doesn't have this problem. @gabors Do you think it would be good to clarify in the title that it only happens with SPM? |
Yes sir this issue started when I switched from using Carthage to SwiftPM |
SwiftPM for me is the issue. Using Lottie from Carthage worked. Now though the animation is not nil loaded from json, setting the animation crashes the app. |
I just tried it with Xcode 11.3 and using Lottie 3.1.5 with SPM and it works ok now with DEAD_CODE_STRIPPING = YES. Also this link https://bugs.swift.org/plugins/servlet/mobile#issue/SR-11564 was mentioned above and there somebody mentioned that it is fixed. |
I tried to add AnimationView in xib file and I got crash. |
I am getting the error at |
Try to create it from code |
My app was crashing when I added a view from a XIB. It was fixed when I added it via code. |
Yes it is also happening with Cocoapods. Whenever I am using lottieanimation in my view, it crashes |
@iamsanketray123 @vladislavsosiuk Can you give more details about the crash from XIB. Thanks. |
@shimazu2 simply use AnimationView in xib and app will crash in runtime while awaking xib or trying to animate it, i don't remember for sure as it was long time ago |
@vladislavsosiuk Well... thats exactly what I have tried.. no crash. |
@shimazu2 the only thing i can to tell is that i used lottie 3.1.6 |
I'm also having the same issue then I noticed that I have to select |
use xib crash, need code |
Closing since this seems like a potentially outdated issue. Feel free to re-open if you're still experiencing this issue. |
I have a similar issue. I used LottieAnimationView. My app crashes on iPhone 6 with iOS 12 which is a real device. When I try it on a simulator with the same config, iPhone 6 with iOS 12, it works as expected. My Podfile:
|
@thedrick
This issue is a:
Which Version of Lottie are you using?
Lottie 3.1.3 release, nut current master branch also crashes
Using Lottie as a SwiftPM package
What Platform are you on?
What Language are you in?
Expected Behavior
Actual Behavior
Code Example
let x = AnimationView(name: "test")
Animation JSON
Any JSON animation from your example project
The text was updated successfully, but these errors were encountered: