xamarin / AndroidX

AndroidX bindings for .NET for Android
MIT License
173 stars 42 forks source link

Add type forwards for `AndroidX.Lifecycle*` `2.8.*` changes. #908

Closed jpobst closed 1 day ago

jpobst commented 1 week ago

Context: https://github.com/xamarin/AndroidX/pull/863 Fixes: https://github.com/dotnet/android/issues/9049 Fixes: https://github.com/xamarin/AndroidX/issues/909

In version 2.8.*, Google moved all the types in 2 libraries into 2 new libraries:

While this is a source compatible change for users, it is not a binary compatible change for users that are relying on NuGets or assemblies that have not been recompiled.

These types may continue to work in Debug builds, but the linker and AOT compiler steps run for Release builds are unable to resolve the moved types, causing unfixable errors (other than recompiling all assemblies).

Adding [TypeForwardedToAttribute] attributes allows the linker and AOT to succeed without recompiling old assemblies.

tuyen-vuduc commented 5 days ago

When do we have these changes rolled out? I really need it for my projects.

MihaMarkic commented 5 days ago

@tuyen-vuduc As a poor man's workaround - downgrade lifecycle libraries to 2.7.0, appcompat to 1.6.1 in android project, and similarly in .net project. It works then until this new fix is released.