Skip to content
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 Crash EXC_BAD_ACCESS #1926

Closed
mihaicris-adoreme opened this issue Jan 20, 2023 · 23 comments · Fixed by airbnb/lottie-spm#5
Closed

Lottie Crash EXC_BAD_ACCESS #1926

mihaicris-adoreme opened this issue Jan 20, 2023 · 23 comments · Fixed by airbnb/lottie-spm#5
Labels

Comments

@mihaicris-adoreme
Copy link

Which Version of Lottie are you using?

Lottie 4.1.0 (lottie-spm)

Expected Behavior

Animation to load

Actual Behavior

App is crashing

Code

private func setupWheelAnimation() {
       // CRASH ON NEXT LINE        Thread 1: EXC_BAD_ACCESS (code=1, address=0x1e) 
        animationView.animation = LottieAnimation.named("wheel_animation")
        animationView.loopMode = .loop
        animationView.play()
    }

Notes

Works as expected in Lottie 3.5.0

Animation JSON

{"v":"5.5.1","fr":23.9759979248047,"ip":0,"op":191.999983381819,"w":563,"h":598,"nm":"deal wheel (1)","ddd":0,"assets":[{"id":"image_0","w":56,"h":56,"u":"images/","p":"img_0.png","e":0},{"id":"image_1","w":35,"h":52,"u":"images/","p":"img_1.png","e":0},{"id":"image_2","w":501,"h":502,"u":"images/","p":"img_2.png","e":0},{"id":"image_3","w":526,"h":526,"u":"images/","p":"img_3.png","e":0}],"layers":[{"ddd":0,"ind":1,"ty":2,"nm":"inner button","refId":"image_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[281,316,0],"ix":2},"a":{"a":0,"k":[28,28,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":191.999983381819,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":2,"nm":"DIAL","refId":"image_1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":11,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":13,"s":[-110]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":16,"s":[-45]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":18,"s":[-110]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":22,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":25,"s":[-110]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":29,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":31,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":32,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":35,"s":[-100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":40,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":42,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":51,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":54,"s":[-90]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":56,"s":[-98]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":62,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":64,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":66,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":105,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":106,"s":[-110]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":108,"s":[-62]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":109,"s":[-110]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":111,"s":[-69]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":113,"s":[-110]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":116,"s":[-61]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":118,"s":[-110]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":123,"s":[-33]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":125,"s":[-110]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":132,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":134,"s":[-90]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":141,"s":[10]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":143,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":147,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":149,"s":[-90]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":155,"s":[10]},{"t":156.999986411175,"s":[0]}],"ix":10},"p":{"a":0,"k":[282.5,49,0],"ix":2},"a":{"a":0,"k":[17.5,26,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":191.999983381819,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":2,"nm":"spinner copy 5","refId":"image_2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.774],"y":[1.825]},"o":{"x":[0.613],"y":[0]},"t":0,"s":[0]},{"i":{"x":[0.14],"y":[1]},"o":{"x":[0.063],"y":[0.09]},"t":9,"s":[-14]},{"i":{"x":[0.833],"y":[1]},"o":{"x":[0.167],"y":[0]},"t":83,"s":[279]},{"i":{"x":[0.703],"y":[1.667]},"o":{"x":[0.683],"y":[0]},"t":94,"s":[279]},{"i":{"x":[0.074],"y":[1]},"o":{"x":[0.072],"y":[0.052]},"t":102,"s":[265]},{"t":185.999983901137,"s":[720]}],"ix":10},"p":{"a":0,"k":[281.5,313,0],"ix":2},"a":{"a":0,"k":[250.5,251,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":191.999983381819,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":2,"nm":"purple outer circle","refId":"image_3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[281,315,0],"ix":2},"a":{"a":0,"k":[263,263,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"ip":0,"op":191.999983381819,"st":0,"bm":0}],"markers":[]}

@calda
Copy link
Member

calda commented Jan 20, 2023

Can you share a sample project that reproduces this issue?

@calda
Copy link
Member

calda commented Jan 20, 2023

Ah, I can reproduce this when running an app using lottie-spm on a physical device. Thanks for the report.

@calda
Copy link
Member

calda commented Jan 20, 2023

Here's a fix: airbnb/lottie-spm#5. We'll release 4.1.1 with this fix later today.

@mihaicris-adoreme
Copy link
Author

Thanks, @calda !

@mihaicris-adoreme
Copy link
Author

mihaicris-adoreme commented Jan 20, 2023

Tested version 4.1.1, still happening. :(
DEBUG build, from Xcode, Device iPhone 12 Pro

Thread 1 Queue : com.apple.main-thread (serial)
#0	0x00000001c2a871b4 in objc_opt_class ()
#1	0x00000001c39c2d54 in swift_getObjectType ()
#2	0x00000001137ff274 in ___lldb_unnamed_symbol8467 ()
#3	0x0000000100b23340 in NotificationsOnboardingViewController.setupWheelAnimation() 
#4	0x0000000100b23120 in NotificationsOnboardingViewController.viewDidLoad()

@calda
Copy link
Member

calda commented Jan 20, 2023

Can you share a copy of a project that reproduces that issue? Are you embedding the Lottie framework in your app target?

Like this:

image

@mihaicris-adoreme
Copy link
Author

Unfortunately I can't share the project.

@mihaicris-adoreme
Copy link
Author

image

@mihaicris-adoreme
Copy link
Author

image

Content of App application bundle

@mihaicris-adoreme
Copy link
Author

image

Package dependency in Xcode

@mihaicris-adoreme
Copy link
Author

image

Buiding with RELEASE mode reveals this error.

@calda
Copy link
Member

calda commented Jan 20, 2023

I'm not able to reproduce this problem with the Example app in the lottie-spm repo, including when building to a physical device with a release configuration. Could you create a standalone sample Xcode project that reproduces this issue for you and share that sample project?

@honkmaster
Copy link

Maybe the crash of @mihaicris-adoreme is related to my reported issue.
airbnb/lottie-spm#5 (comment)

@mihaicris-adoreme
Copy link
Author

mihaicris-adoreme commented Jan 21, 2023

Tested with non-SPM repo and 4.1.1 works fine. - I'll skip the xcframework version for the moment.

I was not able to reproduce with a blank project, although I tried, no crash, however the animation didn't even start. LottieAnimationView is there as a subview, but transparent. No errors in the console.

Maybe other users will reproduce and send a project sample.

@mihaicris-adoreme
Copy link
Author

I am using Tuist to generate the project, maybe could be a reason, however, I have many other xcframework dependencies and no issues. (e.g. Firebase, etc)

@SajjadKharrazi
Copy link

SajjadKharrazi commented Jan 21, 2023

i added lottie-spm repository with 4.1.1 version.
i can run app in physical and simulator device in both Release and Debug env.
but i cant archive my app and i get this error:

Screenshot 2023-01-21 at 19 20 45

i also deleted my DerivedData and problem still happens

@calda
Copy link
Member

calda commented Jan 21, 2023

@SajjadKharrazi, can you test the potential fix I mentioned here: airbnb/lottie-spm#5 (comment)? According to @honkmaster that change fixes a similar problem he was encountering.

@SajjadKharrazi
Copy link

yes it works

@calda
Copy link
Member

calda commented Jan 21, 2023

Great! Will make this change and then probably release 4.1.2 on Monday

@Jamonek
Copy link

Jamonek commented Jan 23, 2023

Thanks! This was driving me crazy haha

@calda
Copy link
Member

calda commented Jan 23, 2023

Published lottie-spm 4.1.2 with a fix for this issue. Thanks for the report and working with us to find a solution!

@mihaicris-adoreme
Copy link
Author

I confirm my issue is resolved with 4.1.2 Thanks!

@Jaeki-Lee
Copy link

Jaeki-Lee commented Mar 12, 2024

I use lottie-ios (4.3.3) but it crush still please anyone help me
It works when use code
let lottie = LottieAnimationView() but storyboard property has the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants