Redth / ZXing.Net.Mobile

Barcode Scanner for Xamarin.iOS, Xamarin.Android, UWP and Tizen
MIT License
1.07k stars 702 forks source link

MAUI Relase build problem #1047

Open srdjo opened 2 years ago

srdjo commented 2 years ago

Hi, I implemented your solution in my MAUI Blazor project and it works great on Android Emulator.

But as soon as I try to build it as Release and make .apk file I get the following error

Severity Code Description Project File Line Suppression State Error Precompiling failed for C:\Users\X\source\repos\X\X.app\obj\Release\net6.0-android\android-arm64\linked\zxing.dll. Mono Ahead of Time compiler - compiling assembly C:\Users\X\source\repos\X\X.app\obj\Release\net6.0-android\android-arm64\linked\zxing.dll AOTID 91700967-DAAD-CE5A-7462-6D8581278FD4 Using profile data file 'C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\6.0.408\Sdk\maui.aotprofile' Using profile data file 'C:\Program Files\dotnet\packs\Microsoft.Maui.Sdk\6.0.408\Sdk\maui-blazor.aotprofile' Failed to load method 0x6000128 from 'C:\Users\X\source\repos\X\X.app\obj\Release\net6.0-android\android-arm64\linked\zxing.dll' due to Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies.. Run with MONO_LOG_LEVEL=debug for more information. AOT of image obj\Release\net6.0-android\android-arm64\linked\zxing.dll failed. X.X C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.424\targets\Microsoft.Android.Sdk.Aot.targets 91

Do you know what might be the problem ?

knocte commented 2 years ago

Did you try https://github.com/redth/ZXing.Net.Maui ?