question

JulianDormon-8927 avatar image
0 Votes"
JulianDormon-8927 asked JulianDormon-8927 commented

.net Maui Deploy to Android in release produces "module is unusable (GUID of dependent assembly Microsoft.EntityFrameworkCore.Sqlite doesn't match"

I am building a .net Maui Android app. I have no problem deploying my app to an Android emulator or real device when in Debug mode. However if I deploy in Release mode, the app crashes on load. The android device log, shows the following error,

Assertion at /__w/1/s/src/mono/mono/mini/aot-runtime.c:3678, condition `is_ok (error)' not met, function:decode_patch, module is unusable (GUID of dependent assembly Microsoft.EntityFrameworkCore.Sqlite doesn't match (expected 'DE191E13-E625-494C-862B-66ABDC9BC3C8', got '0C0A2DB6-8411-4D35-912B-740A5B7BC5CE')).

I had no problem running this in Release mode earlier in the development cycle. I have updated both Visual Studio and Microsoft.EntityFrameworkCore.Sqlite probably several times since I last tested in Release mode.

My project does reference a DbClassLibrary. Both projects reference the same version of Microsoft.EntityFrameworkCore.Sqlite, 6.0.9 which is the latest at the time of writing.

I have tried deleting the App from the Android device, cleaned my solution and re-published.

My Visual Studio specs are as follows:

Visual Studio Community 2022 for Mac Preview Version 17.4 Preview (17.4 build 1583) Installation UUID: 10e52aa0-ff80-4b74-8350-1c794fdcca3c

Runtime .NET 6.0.5 (64-bit) Architecture: Arm64

Roslyn (Language Service) 4.4.0-2.22419.1+ae5663806be933515723b2d5a85faf5d378f460d

NuGet Version: 6.3.0.128

.NET SDK (Arm64) SDK: /usr/local/share/dotnet/sdk/6.0.401/Sdks SDK Versions: 6.0.401 6.0.400 6.0.400-preview.22330.6 MSBuild SDKs: /Applications/Visual Studio (Preview).app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET SDK (x64) SDK Versions: 5.0.408 3.1.423 3.1.422 3.1.421

.NET Runtime (Arm64) Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 6.0.9 6.0.8 6.0.6

.NET Runtime (x64) Runtime: /usr/local/share/dotnet/x64/dotnet Runtime Versions: 5.0.17 3.1.29 3.1.28 3.1.27

Xamarin.Profiler Version: 1.8.0.19 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater Version: 11 ...

dotnet-mauidotnet-sqlite
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I have also successfully published the apk using dotnet build -c Release -f net6.0-android and installed it on the device but it produces the same error.

0 Votes 0 ·

1 Answer

TysonSwing-6918 avatar image
0 Votes"
TysonSwing-6918 answered

Confirmed there is something wrong with latest Visual Studio update. Just yesterday 2022-09-26 my app built in release mode deployed to a physical device worked. As soon as VS update, release build no longer works with the following error:

module is unusable GUID of dependent assembly Microsoft.Maui doesn't match expected BF439B92-AABA-4CDA-BC93-F05A69484D20 995F4EB1-CF87-459A-85C1-A7632CF609E3

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.