markuspalme / LottieNet6

.NET 6 iOS bindings for Lottie
https://www.nuget.org/packages/Lottie.iOS
Apache License 2.0
1 stars 3 forks source link

Crash on some Lottie animations. #3

Open uwe-neuronation opened 11 months ago

uwe-neuronation commented 11 months ago

I get this exception on some of our Lottie files. The app was migrated from Xamarin.iOS to .NET iOS

Same Lottie-Files are ok on Xamarin and crashing on .NET. I could not yet find out what in the json tiggers the problem. Most of our animations behave normal.

Maybe someone can help us.

Objective-C exception thrown.  Name: NSInvalidArgumentException Reason: +[UIColor LOT_colorByLerpingFromColor:toColor:amount:]: unrecognized selector sent to class 0x131369530
Native stack trace:
  CoreFoundation                      0x0000000110a49604 __exceptionPreprocess + 242
  libobjc.A.dylib                     0x000000011ed77a45 objc_exception_throw + 48
  CoreFoundation                      0x0000000110a584d3 __CFExceptionProem + 0
  CoreFoundation                      0x0000000110a4dbbf ___forwarding___ + 1471
  CoreFoundation                      0x0000000110a4fd48 _CF_forwarding_prep_0 + 120
  xxxx.iOS                            0x00000001048d8181 -[LOTColorInterpolator colorForFrame:] + 925
  xxxx.iOS                            0x00000001048dad64 -[LOTFillRenderer performLocalUpdate] + 81
  xxxx.iOS                            0x00000001048d41f9 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] + 212
  xxxx.iOS                            0x00000001048e83d7 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] + 101
  xxxx.iOS                            0x00000001048e83d7 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] + 101
  xxxx.iOS                            0x00000001048e27f3 -[LOTLayerContainer displayWithFrame:forceUpdate:] + 654
  xxxx.iOS                            0x00000001048d99fe -[LOTCompositionContainer displayWithFrame:forceUpdate:] + 526
  xxxx.iOS                            0x00000001048e250d -[LOTLayerContainer display] + 238
  QuartzCore                          0x00000001190827a7 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 479
  QuartzCore                          0x0000000118fa48ed _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 623
  QuartzCore                          0x0000000118fdbf6e _ZN2CA11Transaction6commitEv + 774
  QuartzCore                          0x0000000118fdd1ec _ZN2CA11Transaction25flush_as_runloop_observerEb + 60
  CoreFoundation                      0x00000001109b52f1 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
  CoreFoundation                      0x00000001109afab5 __CFRunLoopDoObservers + 570
  CoreFoundation                      0x00000001109b004d __CFRunLoopRun + 1100
  CoreFoundation                      0x00000001109af704 CFRunLoopRunSpecific + 562
  GraphicsServices                    0x0000000123400c8e GSEventRunModal + 139
  UIKitCore                           0x000000013044165a -[UIApplication _run] + 928
  UIKitCore                           0x00000001304462b5 UIApplicationMain + 101
  libxamarin-dotnet-debug.dylib       0x000000010d89864a xamarin_UIApplicationMain + 58
  ???                                 0x000000016665534b 0x0 + 6012883787
  libmonosgen-2.0.dylib               0x000000010eb67612 mono_jit_runtime_invoke + 1922
  libmonosgen-2.0.dylib               0x000000010ea900e8 mono_runtime_invoke_checked + 136
  libmonosgen-2.0.dylib               0x000000010ea980fc do_exec_main_checked + 92
  libmonosgen-2.0.dylib               0x000000010ebc6ce2 mono_jit_exec + 354
  libxamarin-dotnet-debug.dylib       0x000000010d8dcc77 xamarin_main + 1927
  xxxx.iOS                            0x000000010498def4 main + 68
  dyld                                0x000000010d39ff21 start_sim + 10
FelipeLlinaresGomez commented 9 months ago

Did you find any solution for that exception? @uwe-neuronation I have an app that is migrating from Xamarin iOS to .NET iOS and the same problem is occurring on some lotties.

Thanks.

markuspalme commented 9 months ago

@FelipeLlinaresGomez Could you share one of the failing animations for analysis maybe?

FelipeLlinaresGomez commented 9 months ago

@markuspalme I can't share the animations but I have found a solution for the ones that were failing. The json i was using had a fill layer with a malformed color. It was working fine with Xamarin but now there was something making it crash. I leave the changes I did on the file so it might be useful for someone else. Screenshot 2024-01-30 at 11 15 46

uwe-neuronation commented 9 months ago

Did you find any solution for that exception? @uwe-neuronation I have an app that is migrating from Xamarin iOS to .NET iOS and the same problem is occurring on some lotties.

Thanks.

I did made a new binding based on the current Lottie.xcframework. Since it is a swift only lib a objectiv-C proxy was needed.

cjrvdev commented 1 month ago

Did you find any solution for that exception? @uwe-neuronation I have an app that is migrating from Xamarin iOS to .NET iOS and the same problem is occurring on some lotties. Thanks.

I did made a new binding based on the current Lottie.xcframework. Since it is a swift only lib a objectiv-C proxy was needed.

Hello @uwe-neuronation . Do you happen to have this binding into any public repo to check it out myself? I'm also in the same boat and desperately need a new bind

Thanks