BarcodeScanner.Mobile
BarcodeScanner.Mobile copied to clipboard
Installing the 8.0.0.1 NuGet package to a new empty MAUI .NET8 project does not compile
Describe the bug If I install the nuget package to an empty MAUI .NET8 project, the project does not compile.
To Reproduce Steps to reproduce the behavior:
- Create a new MAUI .Net8 project in Visual Studio 2022
- Install the Barcodescanner.Mobile.Maui package
- Compile.
Expected behavior The project compiles.
Screenshots Unnecessary.
Smartphone (please complete the following information): Nowhere there yet.
Additional context The compilation error:
Severity Code Description Project File Line Suppression State Error JAVA0000 Error in C:\Users\mpathy.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0....\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class: Type androidx.collection.ArraySetKt is defined multiple times: C:\Users\mpathy.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0....\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class, C:\Users\mpathy.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0....\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArraySetKt.class Compilation failed java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\mpathy.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0....\jar\androidx.collection.collection-jvm.jar androidx/collection/ArraySetKt.class at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:126) at com.android.tools.r8.D8.main(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:5) Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: C:\Users\mpathy.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0....\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class at Version.fakeStackEntry(Version_8.1.56.java:0) at com.android.tools.r8.M.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:5) at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:81) at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:32) at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:31) at com.android.tools.r8.utils.R0.b(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:2) at com.android.tools.r8.D8.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:26) at com.android.tools.r8.D8.b(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:13) at com.android.tools.r8.D8.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:24) at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:113) ... 1 more Caused by: com.android.tools.r8.utils.b: Type androidx.collection.ArraySetKt is defined multiple times: C:\Users\mpathy.nuget\packages\xamarin.androidx.collection.jvm\1.3.0.2\buildTransitive\net7.0-android33.0....\jar\androidx.collection.collection-jvm.jar:androidx/collection/ArraySetKt.class, C:\Users\mpathy.nuget\packages\xamarin.androidx.collection.ktx\1.2.0.9\buildTransitive\net6.0-android31.0....\jar\androidx.collection.collection-ktx.jar:androidx/collection/ArraySetKt.class at com.android.tools.r8.utils.O2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:21) at com.android.tools.r8.utils.O2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:26) at com.android.tools.r8.utils.A2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:44) at com.android.tools.r8.utils.A2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:10) at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056) at com.android.tools.r8.utils.A2.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:6) at com.android.tools.r8.graph.b4$a.e(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:7) at com.android.tools.r8.dex.c.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:58) at com.android.tools.r8.dex.c.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:9) at com.android.tools.r8.dex.c.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:8) at com.android.tools.r8.D8.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:29) at com.android.tools.r8.D8.d(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:17) at com.android.tools.r8.D8.c(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:1) at com.android.tools.r8.utils.R0.a(R8_8.1.56_756d1f50f618dd1c39c000f11defb367a21e9e866e3401b884be16c0950f6f79:28) ... 6 more Barcodescanner.Mobile.Maui.Teszt 1
Looks to be a duplicate of https://github.com/JimmyPun610/BarcodeScanner.Mobile/issues/218 There is a fix listed there too
Looks to be a duplicate of #218 There is a fix listed there too
I tried. It causes 245 errors.
this does not work at all. Anyone have a SLN that has successfully installed this nugget ? .NET MAUI
Try to add below package to your MAUI.
<ItemGroup Condition="( '$(TargetFramework)' == 'net8.0-android' )">
<PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.2" />
<PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.2" />
<PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.3.0.2" />
</ItemGroup>
Please reopen it if you still encounter the same problem...
Try to add below package to your MAUI.
<ItemGroup Condition="( '$(TargetFramework)' == 'net8.0-android' )"> <PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.2" /> <PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.2" /> <PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.3.0.2" /> </ItemGroup>
Please reopen it if you still encounter the same problem...
Not able to compile the application after adding suggested code. Is there any alternative?
Try to add below package to your MAUI.
<ItemGroup Condition="( '$(TargetFramework)' == 'net8.0-android' )"> <PackageReference Include="Xamarin.AndroidX.Collection" Version="1.3.0.2" /> <PackageReference Include="Xamarin.AndroidX.Collection.Ktx" Version="1.3.0.2" /> <PackageReference Include="Xamarin.AndroidX.Collection.Jvm" Version="1.3.0.2" /> </ItemGroup>
Please reopen it if you still encounter the same problem...
Not able to compile the application after adding suggested code. Is there any alternative?
I also still got the same problem. Anyone got a solution for this?