Error with lottie xcode 12 Thread 1: EXC_BAD_ACCESS (code=1, address=0x0

Error with lottie xcode 12 Thread 1: EXC_BAD_ACCESS (code=1, address=0x0

Problem Description:

I’m starting with xcode and swift now. I have tu use xcode 12 and I’m trying to add a lottie animation but I always have the same error.

I’ve create a short function with I call on viewDidLoad

This is my Outet:

@IBOutlet weak var animationView: LottieAnimationView!

And my function

override func viewDidLoad() {
    super.viewDidLoad()
    comenzarAnimacion()

}

func comenzarAnimacion(){
    animationView.animation = LottieAnimation.named("68802-arrow-down-purple")
    animationView.contentMode = .scaleToFill
    animationView.loopMode = .loop
    animationView.play()
}

The console shows the next error:

2022-12-06 04:52:22.824975-0800 eventos[1572:28620] [Storyboard] Unknown class _TtC6Lottie13AnimationView in Interface Builder file.

I’ve tryed several difrent lottie json but the same error. any advice?

Solution – 1

"EXC_BAD_ACCESS" error message (code=1, address=0x0) is typically seen when your app is trying to access memory that it is not allowed to access.

But in your case, Class is not recognized by Interface Builder.
To fix this error, you will need to ensure that the Lottie framework is properly included, linked, and imported in your project. Once this is done, Interface Builder should be able to recognize the Lottie AnimationView class and you will be able to use it in your Interface Builder file.

Rate this post
We use cookies in order to give you the best possible experience on our website. By continuing to use this site, you agree to our use of cookies.
Accept
Reject