Open Timonysos opened 4 months ago
Hi, Could you try downgrade the MAUI version to 8.0.41 and try rebuild? It might be caused by different version using in the library and MAUI. If this is the case, I will try to create a new version to use 8.0.61
Hi, Could you try downgrade the MAUI version to 8.0.41 and try rebuild? It might be caused by different version using in the library and MAUI. If this is the case, I will try to create a new version to use 8.0.61
I tried downgrading to MAUI version 8.0.40 but still got the same error.
<ItemGroup>
<PackageReference Include="BarcodeScanner.Mobile.Maui" Version="8.0.40.1" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.40" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.40" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0" />
</ItemGroup>
@Timonysos - Have you tried this set of Android-specific includes:
https://github.com/JimmyPun610/BarcodeScanner.Mobile/issues/240#issuecomment-2194598764
@Timonysos - Have you tried this set of Android-specific includes:
Yes, I tried this set of includes but I didn't work for me.
Hello! We have the same issue after upgrading our app from MAUI 7 to MAUI 8
including the latest version of Xamarin.AndroidX.Activity
worked for me
@stepkillah What version on Xamarin.AndroidX.Activity was that?
@dalevross Did you manage to solve this?
Any news on this error? We are in the process of migrating an application from Xamarin Forms to MAUI, and we haven't been able to make the switch because this library is a fundamental part of the application.
i can install it by this command
dotnet add package BarcodeScanner.Mobile.Maui --prerelease -s=https://api.nuget.org/v3/index.json
but when i publish apk
`MSBUILD : java.exe error JAVA0000:
Error in obj\Release\net8.0-android\lp\171\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class:
Type androidx.activity.ActivityViewModelLazyKt$viewModels$1 is defined multiple times: obj\Release\net8.0-android\lp\171\ jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class, obj\Release\net8.0-android\lp\207\jl\classes .jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class
Compilation failed
java.lang.RuntimeException: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\ Release\net8.0-android\lp\171\jl\classes.jar
androidx/activity/ActivityViewModelLazyKt$viewModels$1.class
at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:135)
at com.android.tools.r8.D8.main(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: obj\Release\net8.0-an droid\lp\171\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class
at Version.fakeStackEntry(Version_8.2.33.java:0)
at com.android.tools.r8.T.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:5)
at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:82)
at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:32)
at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:31)
at com.android.tools.r8.utils.S0.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:2)
at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:42)
at com.android.tools.r8.D8.b(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:13)
at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:40)
at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:122)
... 1 more
Caused by: com.android.tools.r8.utils.b: Type androidx.activity.ActivityViewModelLazyKt$viewModels$1 is defined multiple
times: obj\Release\net8.0-android\lp\171\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class, obj \Release\net8.0-android\lp\207\jl\classes.jar:androidx/activity/ActivityViewModelLazyKt$viewModels$1.class
at com.android.tools.r8.utils.Q2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:21)
at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:54)
at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:10)
at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2056)
at com.android.tools.r8.utils.D2.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6)
at com.android.tools.r8.graph.m4$a.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:6)
at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:61)
at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:12)
at com.android.tools.r8.dex.c.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:9)
at com.android.tools.r8.D8.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:45)
at com.android.tools.r8.D8.d(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:17)
at com.android.tools.r8.D8.c(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:69)
at com.android.tools.r8.utils.S0.a(R8_8.2.33_429c93fd24a535127db6f4e2628eb18f2f978e02f99f55740728d6b22bef16dd:28)
... 6 more
Directory 'obj\Release\net8.0-android\lp\171' is from 'androidx.activity.activity.aar'.
Build failed with 1 error(s) and 305 warning(s) in 183.1s`
Hello, I need one that uses newer packages, specifically, I get this conflict:
Xamarin.AndroidX.Fragment.Ktx 1.8.2 -> Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx (>= 2.8.4)
BarcodeScanner.Mobile.Maui 8.0.40.1 -> Xamarin.AndroidX.Camera.Camera2 1.3.3.2 -> Xamarin.AndroidX.Camera.Core 1.3.3.2 -> Xamarin.AndroidX.Lifecycle.LiveData 2.7.0.3 -> Xamarin.AndroidX.Lifecycle.LiveData.Core.Ktx (>= 2.7.0.3 && < 2.7.1).
I'm also running on maui 8.0.83. Any chance there will be a new release soon ?
@dalevross Did you manage to solve this?
I didn't. I managed to get scanning working with the ZXing library
I added the NuGet package BarcodeScanner.Mobile Version 8.0.40.1 to an empty .NET MAUI8 project and it won't compile.
There are a lot of related issus like #218 and #223. I tried multiple fixes but it seems like I wasn't quiet able to figure out which packages I need to add.
These are my packages I use:
I got the following errors: