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

Fix linker issue by upgrading Xamarin.AndroidX.AppCompat #399

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

angularsen
Copy link
Contributor

Fixes #398

Related:
#397
dotnet/android-libraries#821

After upgrading AndroidX packages in our Xamarin Forms Android project, the linker fails on LottieXamarin using some outdated version of AndroidX types.

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

Changes

  • Update Xamarin.AndroidX.AppCompat from 1.3.1.3 to 1.6.1.6
  • Change Android target from monoandroid10.0 to monoandroid12.0 to support newest AndroidX package

Notes

This needs some assistance to fit into the latest changes of develop with net6.0 / maui. I'm not sure if this is experimental or not, but I was not able to build it.

The PR is currently based on the commit prior to net6.0 / maui update, since our team is currently stuck on standard Xamarin Forms for some time and it solves our need. Maybe we can multi-target both monoandroid12.0 and android-net6.0 to continue support for old Xamarin?

Fixes Baseflow#398

Related:
Baseflow#397
dotnet/android-libraries#821

After upgrading AndroidX packages in our Xamarin Forms Android project, the linker fails on LottieXamarin using some outdated version of AndroidX types.

```
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
```

### Changes
- Update `Xamarin.AndroidX.AppCompat` from 1.3.1.3 to 1.6.1.6
- Change Android target from monoandroid10.0 to monoandroid12.0 to support newest AndroidX package

### Notes
This needs some assistance to fit into the latest changes of `develop` with net6.0 / maui. I'm not sure if this is experimental or not, but I was not able to build it.

The PR is currently based on the commit prior to net6.0 / maui update, since our team is currently stuck on standard Xamarin Forms for some time and it solves our need. Maybe we can multi-target both monoandroid12.0 and android-net6.0 to continue support for old Xamarin?
@angularsen
Copy link
Contributor Author

Just a heads up, but I will not be pursuing this PR as we switched to another library 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

I'll leave the PR open for anyone stumbling into this later or if you wish to take over the PR.

@malo-bo
Copy link

malo-bo commented Dec 20, 2023

@martijn00 , please consider updating using this PR

@logikonline
Copy link

Someone merge this and release it - it takes no effort to resolve this

@JoelRamosM
Copy link

Pleaase... Someone merge this and release it. @malo-bo can i replicate this PR?

@georgeemr
Copy link

Please I need this PR too

@martijn00 martijn00 marked this pull request as ready for review January 23, 2024 12:53
@martijn00 martijn00 merged commit 0c5b596 into Baseflow:develop Jan 23, 2024
@JoelRamosM
Copy link

JoelRamosM commented Jan 25, 2024

@martijn00 whats is the process to release it? there's some CI/CD automation that do i t?

@softlion
Copy link

softlion commented Mar 8, 2024

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

Successfully merging this pull request may close these issues.

AndroidX.Collection dependency error.
7 participants