Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET MAUI application not opening in release while working in debug

Tags:

android

maui

I once asked a similar question when I faced the same problem here in which the Linker was doing its job a bit too efficiently.

Then I found that it was an issue posted on the MAUI repo on GitHub here.

Jonathan Peppers on the GitHub issue suggested that we should add the following to the csproj

<EmbeddedResource Include="ILLink.Descriptors.xml">
  <LogicalName>ILLink.Descriptors.xml</LogicalName>
</EmbeddedResource>

and create an xml file with the following

<linker>
    <assembly fullname="Mono.Android">
        <type fullname="Android.Runtime.InputStreamAdapter" preserve="methods" />
        <type fullname="Android.Runtime.InputStreamInvoker" preserve="methods" />
    </assembly>
</linker>

I even deleted the bin, obj folders, cleaned, rebuilt the project with no luck. So I then tried <AndroidLinkMode>None</AndroidLinkMode> and even that wasn't working.

When opening the app or starting the app in debug, it crashes on the splash screen, producing the following error message MSB3073: The command ""C:\Program Files (x86)\Android\android-sdk\platform-tools\adb" -s emulator-5554 uninstall -k "com.companyname.medbaseapplication"" exited with code 1. 0

How do I solve this problem?

Edit 1: Here is the build output as requested in the comments https://drive.google.com/file/d/1WHbzMHmqLGFE_3Ne3lW5jwp09ZRYAAWk/view?usp=sharing

like image 707
Tanaka Mawere Avatar asked Oct 29 '25 23:10

Tanaka Mawere


1 Answers

I have also had the problem. The app crashed on me because in my xaml code the reference to a control was wrong!

By that I mean:

Failed:

 <toolkit:IconTintColorBehavior TintColor="{Binding BindingContext.SomeProperty, Source={x:Reference WrongReference}}" />

because of the WrongReference. To figuring it out has cost me time and effort! Just check all your x:References in the files you extended!

Note: The 'Output' window gave me a hint about this because this subsequent binding could not resolve. After correcting the issue the app should not crash anymore!

like image 126
Stefano Avatar answered Nov 01 '25 12:11

Stefano