c# - MAUI App Crashes Immediately After Installing Signed APK on Android - Stack Overflow

admin2025-04-16  3

I created a default .NET MAUI app by selecting "Create a new MAUI project" in Visual Studio without modifying any code. The only change I made was in the .csproj file to directly generate an .apk instead of an .aab by adding:

<AndroidPackageFormat>apk</AndroidPackageFormat>

I built the project in Release mode, signed the generated APK using my own keystore (not purchased), and transferred the file to my phone via WhatsApp.

APK installation was successful, but when I launch the app, it crashes immediately. The app runs fine in Debug mode with Emulator from Visual Studio.

What could be causing this issue? How can I fix it?

IMPORTANT: I also tried generating the .aab file, converting it to .apk file, sign it with keystore and install it by USB debugging connection to phone, same results i.e. the app installs but crashes immediately.

Emulator View (both Release and Debug)

转载请注明原文地址:http://www.anycun.com/QandA/1744753781a87131.html