Garrett
Garrett

Reputation: 21

.Net MAUI release deployment crashes but debug deployment works

When I publish my application to an APK file and install it to an android device the app will always crash. This is not the case when I deploy a debug version of the software to the same device. In both cases, the project builds without errors. I get the following exception:

android.runtime.JavaProxyThrowable: System.IO.FileNotFoundException: /MyApp.dll

This happens regardless of device or emulator. This also happens regardless of a release deployment directly from visual studio or using the CLI publish with a manual install of the APK.

I am working in Visual Studio 2022 with .net 7.0 and the android device is on API 33.

Publish and sign the application to an APK file. Then manually install the signed APK on device.

Expected: Successful build of signed APK. Manual install of APK on device. Application runs without issues.

Actual: Successful build of signed APK. Manual install of APK on device. Application crashes on app start with the exception stated.

Upvotes: 1

Views: 925

Answers (2)

dreamboatDev
dreamboatDev

Reputation: 69

Try uncheck AOT compilation This helped me solve the problem

enter image description here

Upvotes: 0

Garrett
Garrett

Reputation: 21

I was using FileVersionInfo.GetVersionInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).FileVersion to display the file version on one of my pages. However this does not work for the release version since it doesn't know where to look.

Upvotes: 1

Related Questions