Skip to content

Current .NET 9 is not properly compatible with Android binding libraries #9698

@Kebechet

Description

@Kebechet

Description

Many android binding libraries require at least: Xamarin.AndroidX.Lifecycle.LiveData version 2.8.7.1
but MAUI 9.0.22 requires older version >=2.8.5.1 && < 2.8.6 and because of this our Android binding fails to build.

The reason why .NET 8.0.100 works with this is because it's dependencies dont contain upper version limit. It requires just Xamarin.AndroidX.Lifecycle.LiveData version >2.6.1.3

Version conflict detected for Xamarin.AndroidX.Lifecycle.LiveData.Core. Install/reference Xamarin.AndroidX.Lifecycle.LiveData.Core 2.8.7.1 directly to project DemoApp to resolve this issue. 
 DemoApp -> Kebechet.Maui.RevenueCat.InAppBilling -> Kebechet.Maui.RevenueCat.Android 7.12.0.4 -> Xamarin.AndroidX.Fragment.Ktx 1.8.5.1 -> Xamarin.AndroidX.Fragment 1.8.5.1 -> Xamarin.AndroidX.Lifecycle.LiveData.Core (>= 2.8.7.1) 
 DemoApp -> Microsoft.Maui.Controls 9.0.22 -> Microsoft.Maui.Controls.Core 9.0.22 -> Microsoft.Maui.Core 9.0.22 -> Xamarin.AndroidX.Lifecycle.LiveData 2.8.5.1 -> Xamarin.AndroidX.Lifecycle.LiveData.Core (>= 2.8.5.1 && < 2.8.6).

Potentially connected to:
marcojak/MauiMTAdmob#113

Steps to Reproduce

  1. Download branch _net9-compatability https://github.com/Kebechet/Maui.RevenueCat.InAppBilling/tree/_net9-compatability
  2. Try to build demo/DemoApp/DemoApp.sln
  3. You will get the error I mentioned above because of dependency incompatabilities

Link to public reproduction project repository

https://github.com/Kebechet/Maui.RevenueCat.InAppBilling/tree/_net9-compatability

Version with bug

9.0.22 SR2.2

Is this a regression from previous behavior?

Yes, this used to work in .NET MAUI

Last version that worked well

8.0.100 SR10

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

nope

Relevant log output

Version conflict detected for Xamarin.AndroidX.Lifecycle.LiveData.Core. Install/reference Xamarin.AndroidX.Lifecycle.LiveData.Core 2.8.7.1 directly to project DemoApp to resolve this issue. 
 DemoApp -> Kebechet.Maui.RevenueCat.InAppBilling -> Kebechet.Maui.RevenueCat.Android 7.12.0.4 -> Xamarin.AndroidX.Fragment.Ktx 1.8.5.1 -> Xamarin.AndroidX.Fragment 1.8.5.1 -> Xamarin.AndroidX.Lifecycle.LiveData.Core (>= 2.8.7.1) 
 DemoApp -> Microsoft.Maui.Controls 9.0.22 -> Microsoft.Maui.Controls.Core 9.0.22 -> Microsoft.Maui.Core 9.0.22 -> Xamarin.AndroidX.Lifecycle.LiveData 2.8.5.1 -> Xamarin.AndroidX.Lifecycle.LiveData.Core (>= 2.8.5.1 && < 2.8.6).

Metadata

Metadata

Assignees

Labels

Area: BindingsIssues in Java Library Binding projects.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions