androidnugetmauizxing

Dotnet 10 - ZXing.Net.Maui 0.6.0 - Xamarin.AndroidX.Tracing dependency conflict breaks Android build


After upgrading to ZXing.Net.Maui version 0.6.0, my .NET MAUI Android application fails to build with a dependency conflict error.

Error Message

error NU1107: Version conflict detected for Xamarin.AndroidX.Tracing.Tracing.Android.

ZXing.Net.Maui 0.6.0 requires version 1.2.0

Xamarin.AndroidX.Tracing.Tracing.Ktx requires version 1.3.0 or higher

Install/reference Xamarin.AndroidX.Tracing.Tracing.Android 1.3.0 directly to project to resolve this issue.

Environment

Steps to Reproduce

  1. Create a new .NET MAUI project
  2. Install ZXing.Net.Maui.Controls version 0.6.0 via NuGet
  3. Initialize in MauiProgram.cs:

builder.UseBarcodeReader();

  1. Build for Android
  2. Build fails with dependency conflict

Temporary Workaround

I worked around this issue by cloning the GitHub repository and using a local project reference instead of the NuGet package, but only for the Debug build. However, the problem still persists in the Release build.

git clone https://github.com/Redth/ZXing.Net.Maui.git

Question

What is the proper way to resolve this dependency conflict without using a local project reference?


Solution

  • This is a known issue on .NET10 and has been fixed with the 0.7.0 release.

    https://github.com/Redth/ZXing.Net.Maui/releases/tag/0.7.0