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.27k stars 1.76k forks source link

Unable to debug MAUI Android app using `<AndroidDeviceUserId>10</AndroidDeviceUserId>` #25730

Closed ramonB1996 closed 2 weeks ago

ramonB1996 commented 2 weeks ago

Description

I am trying to debug an Android app that contains a work-profile (profile '10', instead of the default '0').

Using <AndroidDeviceUserId>10</AndroidDeviceUserId> in the .csproj file, the app installs correctly in my work profile.

But when trying to use the debugger, the app always fails to launch and debugging is not possible at all.

I am using the following:

Please let me know if there are more questions.

Steps to Reproduce

  1. Create a File -> New Maui project
  2. Add <AndroidDeviceUserId>10</AndroidDeviceUserId> to your .csproj
  3. Make sure you have a work-profile installed on your Android device. You can check this with adb shell pm list users command in terminal.
  4. Try to debug the app, it will try to launch and then unexpectedly quits.

Link to public reproduction project repository

No response

Version with bug

8.0.92 SR9.2

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 13

Did you find any workaround?

Sadly no. Debugging is not possible in any way. Building and manually running the app is possible, but without the debugger.

Relevant log output

No response

jfversluis commented 2 weeks ago

Duplicate of https://github.com/dotnet/android/issues/8998