maui: App crashes only in release mode and only when using AOT

Description

On physical devices with Android my app crashes. This happens on 6.0.400 and also on main branch. But it does not crash when deploying to the Android Simulator. On physical devices it also does not crash when I disable AOT.

It worked fine in 6.0.312 but also on main branch few weeks ago.

Is there any way to obtain a crash log or something? I’ve ran adb.exe logcat -v threadtime [device id] > C:\android-debug.log but that only got me a 40mb large text file with hundred thousands of lines.

Steps to Reproduce

I cannot share the app in public

Version with bug

6.0.400 (current)

Last version that worked well

6.0.312

Affected platforms

Android

Affected platform versions

Android 11, physical device

Did you find any workaround?

Disable AOT using <RunAOTCompilation>false</RunAOTCompilation>

Relevant log output

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 16 (8 by maintainers)

Most upvoted comments

For me the crash has been solved over time. Means at some point it suddenly no longer crashed. Could be because of a newer MAUI version, could be because I changed something in code. However I am unable to provide a repro or more information. Other people might have the same issue but I think its better I close this issue and let other people recreate a new issue with more and recent information.

When I select Release in VS Studio and then run it on Android Emulator using VS it does not crash. But when I publish it using cmd and then run the APK file on physical device or Bluestack Emulator it crashes (when AOT is enabled).