LottieFiles / dotlottie-ios

.lottie player for iOS
MIT License
39 stars 6 forks source link

App crashes after updating to new package #29

Open codingcartooningcpa opened 1 month ago

codingcartooningcpa commented 1 month ago

Xcode Version 15.4 iOS Deployment target 16.1

My app starting crashing upon implementation of the new dotLottie package. I believe it is isolated to one of my main animations that ran smoothly and never crashed with the previous dotLottie package. I created an empty project and added my animation assets to the main asset bundle to isolate the issue and found the following:

Here is the SwiftUI code to load from an animation (.lottie / .json) from the main asset bundle:

import SwiftUI
import DotLottie

struct ContentView: View {
    var animation = DotLottieAnimation(fileName: "fish-animation", config: AnimationConfig(autoplay: true, loop: true))

    var body: some View {
        VStack {
            animation.view()
        }
    }
}

1) Using the animation as a .json or .lottie file, the app crashes after 10 seconds and points to the following function as the culprit:

open func render() -> Bool {
        return try! FfiConverterBool.lift(try! rustCall {
            uniffi_dotlottie_player_fn_method_dotlottieplayer_render(self.uniffiClonePointer(), $0)
        })
    }

In the debug console, these errors are posted:

fopen failed for data file: errno = 2 (No such file or directory)
Errors found! Invalidating cache...

I attached the .json file for reference. I used https://lottiefiles.com/tools/lottie-json-to-optimized-lottie-json to convert this file to .lottie and optimized .lottie. fish-animation.json

2) With another animation file, when using the .lottie version, I receive this error in the debug console: HALC_ProxyIOContext.cpp:1346 HALC_ProxyIOContext::IOWorkLoop: skipping cycle due tooverload``

Second File: Animation - 1721402108755.json

Please let me know if this issue can be resolved so I can continue using this animation. Thank you

samuelOsborne commented 1 month ago

Thanks for creating this issue @codingcartooningcpa there is indeed an issue with that animation, I will look in to why this is happening and get back to you, cheers!

codingcartooningcpa commented 1 month ago

Thank you for looking into this!

samuelOsborne commented 2 weeks ago

@codingcartooningcpa I believe this issue is fixed on the latest version of the player, im not experiencing any crashes on my end. Could you please try on yours and let me know?

Cheers

codingcartooningcpa commented 2 weeks ago

Thank you for following up. Unfortunately, the fish-animation as either a .json or .lottie still crashes in the simulator and on my device. The error in the debug console points to the render function. I made sure to update my packages before running.

The second file I attached works properly now as a .json and .lottie.

In the meantime, I decided to use a different animation in my app instead of the one that seems to be causing some issues.