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

Build Error after including Package in .Net 9 #654

Open
WukovatzD opened this issue Dec 14, 2024 · 3 comments
Open

Build Error after including Package in .Net 9 #654

WukovatzD opened this issue Dec 14, 2024 · 3 comments

Comments

@WukovatzD
Copy link

WukovatzD commented Dec 14, 2024

Bug Information

Version Number of Plugin: 9.0.5
Device Tested On: Android 14
Version of VS: 17.13.0 Preview 2.0
Version of Xamarin: .Net 9
Versions of other things you are using: Microsoft.Maui.Controls.Compatibility 9.0.21

Steps to reproduce the Behavior

Integrate project by Nuget PM.

Expected Behavior

Working build

Actual Behavior

Getting this error:
Version conflict detected for Xamarin.AndroidX.Lifecycle.LiveData.Core. Install/reference Xamarin.AndroidX.Lifecycle.LiveData.Core 2.8.7.1 directly to project Fitquest.Maui to resolve this issue. Fitquest.Maui -> Microsoft.Maui.Controls 9.0.10 -> Microsoft.Maui.Controls.Core 9.0.10 -> Microsoft.Maui.Core 9.0.10 -> Xamarin.AndroidX.Navigation.Common 2.8.0.1 -> Xamarin.AndroidX.Lifecycle.ViewModelSavedState 2.8.7.1 -> Xamarin.AndroidX.Lifecycle.LiveData.Core (>= 2.8.7.1 && < 2.8.8) Fitquest.Maui -> Microsoft.Maui.Controls 9.0.10 -> Microsoft.Maui.Controls.Core 9.0.10 -> Microsoft.Maui.Core 9.0.10 -> Xamarin.AndroidX.Lifecycle.LiveData 2.8.5.1 -> Xamarin.AndroidX.Lifecycle.LiveData.Core (>= 2.8.5.1 && < 2.8.6).

Even after installing all version, I get this error in a cycle?

Seems to be in compatible with Microsoft.Maui.Controls >9.0.0?

@Luckre
Copy link

Luckre commented Dec 14, 2024

I can build it successfully, but I am getting the following build warnings:

Detected package version outside of dependency constraint: Xamarin.AndroidX.Activity.Ktx 1.9.2.1 requires Xamarin.AndroidX.Activity (>= 1.9.2.1 && < 1.9.3) but version Xamarin.AndroidX.Activity 1.9.3.1 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Collection.Ktx 1.4.3.1 requires Xamarin.AndroidX.Collection.Jvm (>= 1.4.3.1 && < 1.4.4) but version Xamarin.AndroidX.Collection.Jvm 1.4.5.1 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.LiveData.Ktx 2.8.3.1 requires Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx (>= 2.8.3.1 && < 2.8.4) but version Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx 2.8.7.1 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.LiveData.Ktx 2.8.3.1 requires Xamarin.AndroidX.Lifecycle.LiveData (>= 2.8.3.1 && < 2.8.4) but version Xamarin.AndroidX.Lifecycle.LiveData 2.8.7.1 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.Runtime.Ktx 2.8.5.1 requires Xamarin.AndroidX.Lifecycle.Runtime (>= 2.8.5.1 && < 2.8.6) but version Xamarin.AndroidX.Lifecycle.Runtime 2.8.7.1 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.ViewModel.Ktx 2.8.5.1 requires Xamarin.AndroidX.Lifecycle.ViewModel (>= 2.8.5.1 && < 2.8.6) but version Xamarin.AndroidX.Lifecycle.ViewModel 2.8.7.1 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.Runtime.Ktx.Android 2.8.5.1 requires Xamarin.AndroidX.Lifecycle.Runtime (>= 2.8.5.1 && < 2.8.6) but version Xamarin.AndroidX.Lifecycle.Runtime 2.8.7.1 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Fragment.Ktx 1.8.3.1 requires Xamarin.AndroidX.Fragment (>= 1.8.3.1 && < 1.8.4) but version Xamarin.AndroidX.Fragment 1.8.5.1 was resolved.
Detected package version outside of dependency constraint: Xamarin.AndroidX.Lifecycle.Process 2.8.5.1 requires Xamarin.AndroidX.Lifecycle.Runtime (>= 2.8.5.1 && < 2.8.6) but version Xamarin.AndroidX.Lifecycle.Runtime 2.8.7.1 was resolved.

I intend to publish it to google play test channel to test it on real android devices to check if this warnings affects the in app purchase process or not.

@WukovatzD
Copy link
Author

WukovatzD commented Dec 15, 2024

Thank you a lot for the fast response!

My error message:
Screenshot 2024-12-15 103240

Therefore building is not successful :(

My .csproj beginning:

<Project Sdk="Microsoft.NET.Sdk.Razor">
  <PropertyGroup>
    <TargetFrameworks>net9.0-ios;net9.0-android</TargetFrameworks>
    <OutputType>Exe</OutputType>
    <RootNamespace>Fitquest.Maui</RootNamespace>
    <UseMaui>true</UseMaui>
    <SingleProject>true</SingleProject>
    <ImplicitUsings>enable</ImplicitUsings>
    <EnableDefaultCssItems>false</EnableDefaultCssItems>
    <Nullable>enable</Nullable>
    .....

I use a Maui Hybrid app.

@Engisan
Copy link

Engisan commented Jan 18, 2025

Hello guys, this issue is not directly connected to this specific plugin.

This is kinda "common" issue with all packages using android api as they can use different versions of the libraries and then you receive the conflicts. It sux hard but it is what it is.

There is a solution for that which is kinda time consuming but could help you and it is described here:

dotnet/android-libraries#764 (comment)

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

No branches or pull requests

3 participants