Baseflow / LottieXamarin

Render After Effects animations natively on Android, iOS, MacOS and TvOS for Xamarin
https://baseflow.com
Apache License 2.0
1.22k stars 261 forks source link

AndroidX.Collection dependency error. #398

Closed Taofeek-Allison closed 10 months ago

Taofeek-Allison commented 12 months ago

🐛 Bug Report

Severity Code Description Project File Line Suppression State Error Mono.Linker.MarkException: Error processing method: 'AndroidX.Collection.SparseArrayCompat Com.Airbnb.Lottie.LottieComposition::get_Characters()' in assembly: 'Lottie.Android.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve AndroidX.Collection.SparseArrayCompat at Mono.Linker.Steps.MarkStep.HandleUnresolvedType(TypeReference reference) at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference) at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference) at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method) at Mono.Linker.Steps.MarkStep.ProcessQueue() --- End of inner exception stack trace --- at Mono.Linker.Steps.MarkStep.ProcessQueue() at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue() at Mono.Linker.Steps.MarkStep.Process() at Mono.Linker.Steps.MarkStep.Process(LinkContext context) at MonoDroid.Tuner.MonoDroidMarkStep.Process(LinkContext context) at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step) at Mono.Linker.Pipeline.Process(LinkContext context) at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context) at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res) at Xamarin.Android.Tasks.LinkAssemblies.RunTask() at Microsoft.Android.Build.Tasks.AndroidTask.Execute() in /Users/runner/work/1/s/xamarin-android/external/xamarin-android-tools/src/Microsoft.Android.Build.BaseTasks/AndroidTask.cs:line 17 ChartBuilder.XForms.Android

Expected behavior

Lotie package should be compatible with the latest AndroidX Libraries.

Reproduction steps

  1. Update AndroidX packages to the latest
  2. Build for release
  3. the app fails to build for release but builds for debug only.

Configuration

Version: 4.1.0

Platform:

angularsen commented 11 months ago

Related: https://github.com/xamarin/AndroidX/issues/821 https://github.com/Baseflow/LottieXamarin/issues/397

angularsen commented 11 months ago

Not to rain on this project, but it seems to not be actively maintained.

For others running into this, there is an alternative library that is maintained by the Xamarin team, supports both Xamarin Forms and MAUI and seems fairly regularly updated. It worked well for our Xamarin Forms project and we will use that instead.

https://github.com/mono/SkiaSharp.Extended (must use prerelease nugets as of now)

This article was helpful although it explains for MAUI: https://cedricgabrang.medium.com/implementing-lottie-animations-in-your-net-maui-application-62bd484af651

Larhei commented 10 months ago

@martijn00

any chance to get an update?

Larhei commented 10 months ago

@martijn00 Thanks