-
Notifications
You must be signed in to change notification settings - Fork 50
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
Type androidx.lifecycle.ClassesInfoCache$CallbackInfo is defined multiple times #747
Comments
Also, my MAUI project (NDC.Mobile) references another .NET 7 library project (NDC.Utils) which has the following .csproj :
|
Thanks for the feedback. Please try updating to the latest packages AndroidX and GPS-FB-MLKit |
Please add those 2 dependencies:
And please report if this works. |
Thank you for your reply, can you elaborate a bit more on which package I should install/update ? (as there are many Xamarin.AndroidX. packages) |
Alos, when trying to add the specific version on these two packages, my compilation breaks with error NU1008 (Projects that use central package version management should not define the version on the PackageReference items but on the PackageVersion items: PackageId.) Adding Condition="'$(UseMaui)' != 'true'" in Directory.Packages.props for these two doesn't seem to help :( |
In order to pinpoint the culprit, I disabled central package management for my MAUI project. Here is my csproj configuration :
I'm getting the following (slightly different from before) :
|
Those look good
Now 3rd party - possible problems
|
And no package reference related in any way to Android |
After removing this reference, my issue has gone away. It seems impossible to use reference a .Net 7 library project inside a MAUI project |
I finally figured it out : my NDC.Utils project I was referencing was incorrectly configured. Here is the simplification I found :
Adding a target to net7.0-android was apparently adding duplicated references, hence my problem. Thank you for your time. |
This is why we are here. closing this issue |
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
VS2022 MAUI .Net 7
Description
Visual Studio 2022 Enterprise 17.6.4 - Xamarin.Android SDK 13.2.0.6 (d17-5/a200af1)
My project targets net7.0-android. When trying to compile my new MAUI project, I've got the following issue :
Type androidx.lifecycle.ClassesInfoCache$CallbackInfo is defined multiple times
Here is my .csproj package configuration :
On my solution, I'm also using central package management, here is my Directory.Packages.props
I'm pretty much new to MAUI development, so please let me know if there's something more I can add in order to help investigating this issue
Steps to Reproduce
Add a new MAUI application project (limited to Android .Net 7)
Try adding packages with Directory.Packages.props
Try compiling
Did you find any workaround?
Not yet
Relevant log output
The text was updated successfully, but these errors were encountered: