dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.04k stars 1.73k forks source link

cannot debug or show output of Release built application on Android #6567

Closed janseris closed 2 years ago

janseris commented 2 years ago

Description

Release build for Android takes 2.5 minutes to build and run for Android on i7 6700 HQ and fast SSD for the template MAUI Blazor project. Moreover, this message started showing. Reinstalling VS did not help (completely, all versions including VS Installer), resetting settings did not help. Shows also for new apps created from template.

Start debugging Android application ...
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.mauiapp3/crc64e73e5e987e2fb5cd.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.mauiapp3/crc64e73e5e987e2fb5cd.MainActivity }

Android application is running (debug is disabled in android project properties).

Yesterday with RC 1, I have been able to show output of 1 Release run of my Blazor MAUI app which showed this error which also probably causes my MAUI Blazor application to crash on Release build. This Error type 3 crash on startup can be solved using <PublishTrimmed>False</PublishTrimmed>.

image

Since then, all the time: Android application is running (debug is disabled in android project properties). for all projects. There is no such setting to Enable/Disable debugging in Android project properties. And thus I cannot see any output and cannot watch Trace.WriteLine output or watch what caused application crash when in Release mode. And adding <DebugSymbols>True</DebugSymbols> to .csproj does not solve the issue.

Default settings for all my projects look like this: image

I need to diagnose the error to report it. Please help me what to do to get debugging back for Release build.

Steps to Reproduce

create new maui app press run on android in Release mode image

Version with bug

Release Candidate 2 (current)

Last version that worked well

Release Candidate 1

Affected platforms

Android

Affected platform versions

Android 11 (API 30)

Did you find any workaround?

no

Relevant log output

No response

XamlTest commented 2 years ago

Verified this issue with Visual Studio Enterprise 17.3.0 Preview 1.0 [32414.199.main]. Repro on Android with a Maui app template.

Redth commented 2 years ago

@jonathanpeppers could you have a look at this one? We can pull it back to 6.0.300 if necessary, but looks like servicing bar for now.

jonathanpeppers commented 2 years ago

@janseris it seems like you might reporting several different problems at once. Should we investigate your crash and why you need PublishTrimmed=false?

If the app is crashing can you enable more logging with:

adb shell setprop debug.mono.log default,timing,assembly,mono_log_level=debug,mono_log_mask=all

Then save the log with adb logcat -d > log.txt:

https://docs.microsoft.com/en-us/xamarin/android/deploy-test/debugging/android-debug-log?tabs=windows#accessing-from-the-command-line

@XamlTest which problem were you able to repro with 17.3.0 Preview 1.0 [32414.199.main]? Can you give some details?

ghost commented 2 years ago

Hi @janseris. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

janseris commented 2 years ago

@jonathanpeppers
Thanks, as a quick response I am adding that I cannot see output for Release application even if it is a different one which doesn't require PublishTrimmed=false. I cannot see output for any MAUI application executed in Release configuration (always Android application is running (debug is disabled in android project properties).)

I will try your suggestion about logging from Release using adb later.

And I think that @XamlTest has reproduced the issue with the output missing because I haven't posted the source code which requires PublishTrimmed=false to run without crashing (and that code is a large Blazor MAUI application).

jonathanpeppers commented 2 years ago

@janseris I would use adb logcat at the command-line. Release builds do not show output in the IDE -- this is the same behavior you get in Xamarin.Android projects.

You can also try Tools > Android > Device Log, but using adb logcat is easier if you want to share the file with us.

janseris commented 2 years ago

@jonathanpeppers

Release builds do not show output in the IDE

it has actually happened to me but only 3 times during last 3 weeks

janseris commented 2 years ago

~~Sadly adb cannot be found on my machine (tried Powershell, cmd.exe, Git CMD). I also tried the following command lines in Visual Studio: Package Manager Console, Developer PowerShell, Command Window~~

And I cannot find it at %USERPROFILE%\AppData\Local\Android\sdk\platform-tools as suggested on stackoverflow when searching for the issue.

I think this would require longer setup.

'adb' is not recognized as an internal or external command,
operable program or batch file.

Edit: found it at C:\Program Files (x86)\Android\android-sdk\platform-tools and added this to PATH and will try later

Btw. which command line do I run this on to apply for the currently executed application in Visual Studio?

jonathanpeppers commented 2 years ago

adb shell setprop sets a system property for the attached device or running emulator. If there is only 1, you won't have to select a device/emulator. To clear this value, you'll need to reboot the device/emulator or set it to an empty string.

adb logcat -d > log.txt pull the system log and saves it to a file.

janseris commented 2 years ago

@jonathanpeppers

adb shell setprop debug.mono.log default,timing,assembly,mono_log_level=debug,mono_log_mask=all

Please could you also post a command to bring back the normal output verbosity? I have now super detailed output when running on Debug and cannot find my actual Debug output (Trace.WriteLine messages) or Exceptions thrown. Thank you

jonathanpeppers commented 2 years ago

@janseris you can either reboot the device or just set it something else? This would clear it:

adb shell "setprop debug.mono.log ''"
janseris commented 2 years ago

@jonathanpeppers

Should we investigate your crash and why you need PublishTrimmed=false? If the app is crashing can you enable more logging

log.txt

In this log, I have run a Release application on Android 11 device. The application behavior is that it crashes on startup (after splash screen and quickly after blank white screen of Blazor shows (before Loading... appears in Blazor) as mentioned previously. This does not happen when trimming is disabled. There is no DB call or I/O operation invoked during the startup. Everything is user-controlled later via buttons in the UI.

jonathanpeppers commented 2 years ago

This looks like it might be duplicate of: https://github.com/dotnet/runtime/issues/67402

The fix for this will be shipping soon, let us check back with you when it's available.

janseris commented 2 years ago

@jonathanpeppers Thanks. I tried executing the following command and then re-running the application on Release and outputting the log via adb logcat -d > log.txt:

you can either reboot the device or just set it something else? This would clear it:

adb shell "setprop debug.mono.log ''"

And the output when running the application on Release once is now the following. Could you please check if the verbosity is back to normal or the command did not work? I suspect that there is still output which is not normally visible. Thank you. log after output verbosity minimized.txt

jonathanpeppers commented 2 years ago

Yes, I don't see log messages in the minimized one like:

05-06 21:49:12.737 12213 12213 D Mono    : ...
05-06 21:49:12.737 12213 12213 D monodroid-assembly: ...
05-06 21:49:12.737 12213 12213 I monodroid-timing: ...

Android logs random stuff all the time, so that is what is in there now.

janseris commented 2 years ago

I am also experiencing crash on startup when running Debug without trimming. It says something something Bluetooth but I am not using Bluetooth in my app.

This looks like it might be duplicate of: https://github.com/dotnet/runtime/issues/67402

I am however not using HttpClient (or not any that I know of, I use EF Core and some Blazor component libraries). This is reproduced always:

Forwarding debugger port 8896
Detecting existing process
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.Tempus.GUI.Mobile.MAUIBlazor/crc64ed4ef8507292954f.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.Tempus.GUI.Mobile.MAUIBlazor/crc64ed4ef8507292954f.MainActivity }
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Tempus.GUI.Mobile.MAUIBlazor.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Mono.Android.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Java.Interop.dll [External]
Resolved pending breakpoint for 'Android.Runtime.JNIEnv.RegisterJniNatives(System.IntPtr, System.Int32, System.IntPtr, System.IntPtr, System.Int32)' to /Users/runner/work/1/s/xamarin-android/src/Mono.Android/Android.Runtime/JNIEnv.cs:124 [0x00000].
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Maui.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.ComponentModel.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Runtime.CompilerServices.Unsafe.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Maui.Essentials.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.Core.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Runtime.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.DependencyInjection.Abstractions.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Collections.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/MessagePack.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Maui.Controls.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.ObjectModel.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Maui.Controls.Xaml.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Blazorise.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.Configuration.dll [External]
[bile.MAUIBlazo] Late-enabling -Xcheck:jni
[bile.MAUIBlazo] Unquickening 17 vdex files!
[Perf] Connecting to perf service.
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[NetworkSecurityConfig] No Network Security Config specified, using platform default
[debug-app-helper] Checking if libmonodroid was unpacked to /data/app/~~1OR-0Z48yPrIBsoTBv5nvw==/com.companyname.Tempus.GUI.Mobile.MAUIBlazor-oNwb3mpqQeSPXQ2WDabiaw==/lib/arm64/libmonodroid.so
[debug-app-helper] Native libs extracted to /data/app/~~1OR-0Z48yPrIBsoTBv5nvw==/com.companyname.Tempus.GUI.Mobile.MAUIBlazor-oNwb3mpqQeSPXQ2WDabiaw==/lib/arm64, assuming application/android:extractNativeLibs == true
[debug-app-helper] Setting up for DSO lookup in app data directories
[debug-app-helper] Added filesystem DSO lookup location: /data/app/~~1OR-0Z48yPrIBsoTBv5nvw==/com.companyname.Tempus.GUI.Mobile.MAUIBlazor-oNwb3mpqQeSPXQ2WDabiaw==/lib/arm64
[debug-app-helper] Using runtime path: /data/app/~~1OR-0Z48yPrIBsoTBv5nvw==/com.companyname.Tempus.GUI.Mobile.MAUIBlazor-oNwb3mpqQeSPXQ2WDabiaw==/lib/arm64
[debug-app-helper] checking directory: `/data/user/0/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/lib`
[debug-app-helper] directory does not exist: `/data/user/0/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/lib`
[debug-app-helper] Checking whether Mono runtime exists at: /data/user/0/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/libmonosgen-2.0.so
[debug-app-helper] Checking whether Mono runtime exists at: /data/app/~~1OR-0Z48yPrIBsoTBv5nvw==/com.companyname.Tempus.GUI.Mobile.MAUIBlazor-oNwb3mpqQeSPXQ2WDabiaw==/lib/arm64/libmonosgen-2.0.so
[debug-app-helper] Mono runtime found at: /data/app/~~1OR-0Z48yPrIBsoTBv5nvw==/com.companyname.Tempus.GUI.Mobile.MAUIBlazor-oNwb3mpqQeSPXQ2WDabiaw==/lib/arm64/libmonosgen-2.0.so
[bile.MAUIBlazo] Attempt to remove non-JNI local reference, dumping thread
[DOTNET] JNI_OnLoad: JNI_OnLoad in pal_jni.c
[monodroid] Creating public update directory: `/data/user/0/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__`
[bile.MAUIBlazo] Attempt to remove non-JNI local reference, dumping thread
[monodroid-debug] Trying to initialize the debugger with options: --debugger-agent=transport=dt_socket,loglevel=0,address=127.0.0.1:8896,server=y,embedding=1
[monodroid-assembly] open_from_bundles: failed to load assembly Tempus.GUI.Mobile.MAUIBlazor.dll
[monodroid-gc] GREF GC Threshold: 46080
[monodroid-assembly] open_from_bundles: failed to load assembly Mono.Android.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Java.Interop.dll
[bile.MAUIBlazo] Attempt to remove non-JNI local reference, dumping thread
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.CompilerServices.Unsafe.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Essentials.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Core.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.Abstractions.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.dll
[monodroid-assembly] open_from_bundles: failed to load assembly MessagePack.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.ObjectModel.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Xaml.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Blazorise.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Configuration.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Configuration.Abstractions.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Logging.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.AspNetCore.Components.WebView.Maui.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Blazorise.Bootstrap5.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Blazorise.Icons.FontAwesome.dll
[monodroid-assembly] open_from_bundles: failed to load assembly BlazorPanzoom.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.AspNetCore.Components.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Tempus.Vystavba.Data.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.EntityFrameworkCore.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Tempus.Vystavba.Core.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Tempus.Vystavba.API.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Tempus.Vystavba.Services.dll
[monodroid-assembly] open_from_bundles: failed to load assembly DiskCacheStorage.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.RegularExpressions.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.Configuration.Abstractions.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.Logging.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.AspNetCore.Components.WebView.Maui.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Blazorise.Bootstrap5.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Blazorise.Icons.FontAwesome.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/BlazorPanzoom.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.AspNetCore.Components.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Tempus.Vystavba.Data.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.EntityFrameworkCore.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Tempus.Vystavba.Core.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Tempus.Vystavba.API.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Tempus.Vystavba.Services.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/DiskCacheStorage.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Text.RegularExpressions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Threading.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Graphics.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Logging.Abstractions.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Threading.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Maui.Graphics.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.Logging.Abstractions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.AppCompat.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.Google.Android.Material.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.AppCompat.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.Google.Android.Material.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.TypeConverter.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.ComponentModel.TypeConverter.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Uri.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Private.Uri.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.Concurrent.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Collections.Concurrent.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Linq.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Fragment.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.Common.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.ViewModel.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.Fragment.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.Lifecycle.Common.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.Lifecycle.ViewModel.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.DrawerLayout.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CustomView.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Navigation.Runtime.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.DrawerLayout.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.CustomView.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.Navigation.Runtime.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.AspNetCore.Components.WebView.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.AspNetCore.Components.WebView.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.JSInterop.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.AspNetCore.Components.Web.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.JSInterop.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.AspNetCore.Components.Web.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Options.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.Options.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Text.Json.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Text.Json.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.ComponentModel.Primitives.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Linq.Expressions.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.ComponentModel.Primitives.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Linq.Expressions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Collections.Immutable.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Collections.Immutable.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Data.SqlClient.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Data.Common.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Data.SqlClient.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Data.Common.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Memory.dll
[monodroid-assembly] open_from_bundles: failed to load assembly MessagePack.Annotations.dll
[monodroid-assembly] open_from_bundles: failed to load assembly netstandard.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Reflection.Emit.ILGeneration.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Memory.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/MessagePack.Annotations.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/netstandard.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Reflection.Emit.ILGeneration.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.DependencyInjection.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.DependencyInjection.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Xml.ReaderWriter.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Xml.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Xml.ReaderWriter.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Private.Xml.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Runtime.Loader.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Runtime.Loader.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Numerics.Vectors.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Numerics.Vectors.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.FileProviders.Abstractions.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.FileProviders.Abstractions.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.RecyclerView.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SwipeRefreshLayout.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CardView.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.RecyclerView.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.SwipeRefreshLayout.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.CardView.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Activity.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.SavedState.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Loader.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.Activity.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.SavedState.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.Loader.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Maui.Controls.Compatibility.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Tempus.Core.MAUI.Files.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Tempus.Core.MAUI.Images.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Maui.Controls.Compatibility.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Tempus.Core.MAUI.Files.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Tempus.Core.MAUI.Images.dll
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.CoordinatorLayout.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.CoordinatorLayout.dll [External]
[WebViewFactory] Loading com.google.android.webview version 100.0.4896.127 (code 489612733)
[bile.MAUIBlazo] Accessing hidden method Landroid/os/Trace;->isTagEnabled(J)Z (greylist, reflection, allowed)
[bile.MAUIBlazo] Accessing hidden method Landroid/os/Trace;->traceBegin(JLjava/lang/String;)V (greylist, reflection, allowed)
[bile.MAUIBlazo] Accessing hidden method Landroid/os/Trace;->traceEnd(J)V (greylist, reflection, allowed)
[bile.MAUIBlazo] Accessing hidden method Landroid/os/Trace;->asyncTraceBegin(JLjava/lang/String;I)V (greylist, reflection, allowed)
[bile.MAUIBlazo] Accessing hidden method Landroid/os/Trace;->asyncTraceEnd(JLjava/lang/String;I)V (greylist, reflection, allowed)
[cr_WVCFactoryProvider] Loaded version=100.0.4896.127 minSdkVersion=29 isBundle=true multiprocess=true packageId=2
[cr_LibraryLoader] Successfully loaded native library
[cr_CachingUmaRecorder] Flushed 9 samples from 9 histograms.
[TetheringManager] registerTetheringEventCallback:com.companyname.Tempus.GUI.Mobile.MAUIBlazor
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.FileProviders.Embedded.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.FileProviders.Embedded.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.FileProviders.Composite.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.FileProviders.Composite.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly System.Xml.XDocument.dll
[monodroid-assembly] open_from_bundles: failed to load assembly System.Private.Xml.Linq.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Xml.XDocument.dll [External]
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/System.Private.Xml.Linq.dll [External]
[monodroid-assembly] open_from_bundles: failed to load assembly Microsoft.Extensions.Primitives.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Microsoft.Extensions.Primitives.dll [External]
[bile.MAUIBlazo] Accessing hidden method Landroid/media/AudioManager;->getOutputLatency(I)I (greylist, reflection, allowed)
[AdrenoGLES-0] QUALCOMM build                   : 559e78c, Ib9d997268a
[AdrenoGLES-0] Build Date                       : 10/13/20
[AdrenoGLES-0] OpenGL ES Shader Compiler Version: EV031.32.02.02
[AdrenoGLES-0] Local Branch                     : mybrancheb0d76cb-f27a-f1ff-9cdc-1458d0b52ae8
[AdrenoGLES-0] Remote Branch                    : quic/gfx-adreno.lnx.1.0.r99-rel
[AdrenoGLES-0] Remote Branch                    : NONE
[AdrenoGLES-0] Reconstruct Branch               : NOTHING
[AdrenoGLES-0] Build Config                     : S P 10.0.7 AArch64
[AdrenoGLES-0] Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so
[AdrenoGLES-0] PFP: 0x016ee190, ME: 0x00000000
[cr_media] Requires BLUETOOTH permission
[monodroid-assembly] open_from_bundles: failed to load assembly Xamarin.AndroidX.Lifecycle.LiveData.Core.dll
Loaded assembly: /data/data/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/files/.__override__/Xamarin.AndroidX.Lifecycle.LiveData.Core.dll [External]
[bile.MAUIBlazo] Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
[bile.MAUIBlazo] Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
Thread started:  #2
[Choreographer] Skipped 33 frames!  The application may be doing too much work on its main thread.
Thread started:  #3
[chromium] [ERROR:directory_reader_posix.cc(42)] opendir /data/user/0/com.companyname.Tempus.GUI.Mobile.MAUIBlazor/cache/WebView/Crashpad/attachments/6eba5b6c-3d65-43ee-b91b-12e38c1b2c33: No such file or directory (2)
[chromium] [WARNING:minidump_to_upload_parameters.cc(67)] duplicate annotation name ptype, discarding value browser
Thread started:  #4
Thread started:  #5
[bile.MAUIBlazo] * Assertion at /__w/1/s/src/mono/mono/metadata/object.c:4179, condition `ctor' not met
[bile.MAUIBlazo] * Assertion at /__w/1/s/src/mono/mono/metadata/object.c:4179, condition `ctor' not met
[libc] Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 15181 (ThreadPoolForeg), pid 15107 (bile.MAUIBlazor)

This is also happening when switching from Publish trimmed False to Publish trimmed True on Debug (only once -> probably a fight between old and new compiled files - any following build with Publish trimmed True succeeds):

1>Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java:44: error: no suitable constructor found for BaseCellView(Context,AttributeSet,int,int)
1>      super (p0, p1, p2, p3);
1>      ^
1>    constructor BaseCellView.BaseCellView(Context) is not applicable
1>      (actual and formal argument lists differ in length)
1>    constructor BaseCellView.BaseCellView(Context,AttributeSet) is not applicable
1>      (actual and formal argument lists differ in length)
1>    constructor BaseCellView.BaseCellView(Context,AttributeSet,int) is not applicable
1>      (actual and formal argument lists differ in length)
1>Note: Some input files use or override a deprecated API.
1>Note: Recompile with -Xlint:deprecation for details.
1>Note: Some input files use unchecked or unsafe operations.
1>Note: Recompile with -Xlint:unchecked for details.
1>1 error
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java(44,3): javac.exe error JAVAC0000:  error: no suitable constructor found for BaseCellView(Context,AttributeSet,int,int)
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java(44,3): javac.exe error JAVAC0000:       super (p0, p1, p2, p3);
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java(44,3): javac.exe error JAVAC0000:     constructor BaseCellView.BaseCellView(Context) is not applicable
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java(44,3): javac.exe error JAVAC0000:       (actual and formal argument lists differ in length)
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java(44,3): javac.exe error JAVAC0000:     constructor BaseCellView.BaseCellView(Context,AttributeSet) is not applicable
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java(44,3): javac.exe error JAVAC0000:       (actual and formal argument lists differ in length)
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java(44,3): javac.exe error JAVAC0000:     constructor BaseCellView.BaseCellView(Context,AttributeSet,int) is not applicable
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java(44,3): javac.exe error JAVAC0000:       (actual and formal argument lists differ in length)
1>obj\Debug\net6.0-android\android\src\crc6477f0d89a9cfd64b1\TextCellRenderer_TextCellView.java(44,3): javac.exe error JAVAC0000:
1>Done building project "Tempus.GUI.Mobile.MAUIBlazor.csproj" -- FAILED.
PureWeen commented 2 years ago

@janseris can you try again with the latest preview of VS Preview?

@jonathanpeppers do you have any additional thoughts/notes?

ghost commented 2 years ago

Hi @janseris. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

janseris commented 2 years ago

@PureWeen Yes, this still happens. I am using latest VS 2022 Preview with latest MAUI version.

Microsoft Visual Studio Community 2022 (64-bit) - Preview
Version 17.3.0 Preview 2.0

Breakpoints are not hit and prints and internal exceptions which are displayed during Debug, are not displayed in Output window.

The output is similar or the same as when this was reported:


Start debugging Android application ...
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.companyname.mauiapp11/crc6457128f1206485692.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.companyname.mauiapp11/crc6457128f1206485692.MainActivity }

Android application is running (debug is disabled in android project properties).

,,,debug is disabled in android project properties) there are no Android properties to "Enable debug" though.

For a MAUI app executed on Windows in Release configuration, breakpoints are hit and all prints are displayed correctly.

jonathanpeppers commented 2 years ago

This issue lists a lot of different problems in one, so I'm not sure which ones are resolved.

I believe the behavior for debugging Release apps are the same as in Xamarin.Android -- they don't actually debug, and you need to use Tools > Android > Device Log to see adb logcat output without debugging. I think we could log a feature request for the Xamarin extension in the IDE, if that should be improved? That would be Help > Send Feedback > Suggest a Feature.

janseris commented 2 years ago

This issue lists a lot of different problems in one, so I'm not sure which ones are resolved.

I believe the behavior for debugging Release apps are the same as in Xamarin.Android -- they don't actually debug, and you need to use Tools > Android > Device Log to see adb logcat output without debugging. I think we could log a feature request for the Xamarin extension in the IDE, if that should be improved? That would be Help > Send Feedback > Suggest a Feature.

Thanks. I have already done that. On May 4, I have reported it as an issue and it was transformed into a suggestion.

https://developercommunity.visualstudio.com/t/Output-of-Release-application-on-Android/10030028?entry=suggestion&ref=native&refTime=1656450032633&refUserId=2f1a18fa-bdfc-6696-827c-496cd375d554

The lifecycle of the request stopped 1 month ago (May 27 2022) and since then no news.

jonathanpeppers commented 2 years ago

Is there another issue we should look into here, or close this one? I think we can track the behavior of the Xamarin extension for Release builds with the item above. Please upvote!

janseris commented 2 years ago

@jonathanpeppers there is an additional issue about trimming here but I'll continue it somewhere else and close this and follow the Xamarin extension. Is the suggestion formulated sufficiently or do you think I should create a new, clear, suggestion for Visual Studio and maybe on GitHub and not on VS feedback?