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

App crashes after updating to new package #29

Open
codingcartooningcpa opened this issue Jul 18, 2024 · 4 comments
Open

App crashes after updating to new package #29

codingcartooningcpa opened this issue Jul 18, 2024 · 4 comments

Comments

@codingcartooningcpa
Copy link

codingcartooningcpa commented Jul 18, 2024

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

  1. 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 to overload``

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
Copy link
Member

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
Copy link
Author

Thank you for looking into this!

@samuelOsborne
Copy link
Member

@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
Copy link
Author

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.

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

No branches or pull requests

2 participants