Skip to content

Unable to debug Xamarin Forms Android project in VS 17.3 Preview 3 with Fast Deploy disabled #7182

@BlueRaja

Description

@BlueRaja

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

VS 17.3 Preview 3

Description

After updating to VS 17.3 Preview 3, debugging my Xamarin Forms Android project in the Android emulator doesn't work. The emulator opens, the project is successfully deployed, but then the app opens and immediately closes.

The deploy succeeds, so the app can still be run on the emulator by clicking the app-icon. But, the debugger will not be attached, making it extremely difficult to debug anything.

Downgrading to VS 17.2 (where debugging Android emulation works) is not an option for me, because Xamarin iOS is broken in that version 🤦

Steps to Reproduce

  1. Open any Xamarin Forms Android project
  2. In Project Properties --> Android Options, make sure "Fast Deploy" is disabled
  3. Attempt to debug

Did you find any workaround?

Enable "Fast Deploy".

I previously had disabled it because of issues that I don't remember. I have no idea if those have been fixed.

Relevant log output

Debug Output:

Terminated existing process
> am start -a "android.intent.action.MAIN" -c "android.intent.category.LAUNCHER" -n "com.Ringotan/crc64da92c648e6bdeb4e.MainActivity"
> Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.Ringotan/crc64da92c648e6bdeb4e.MainActivity }

Could not connect to the debugger.

Xamarin Diagnostics Output

[I:]:                     Got new device list from adb with 1 devices
[I:]:                     Got new device list from adb with 1 devices
[I:]:                     Got new device list from adb with 1 devices
[E:]:                     Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
System.FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
   at System.String.Format(String format, Object[] args)
   at Mono.AndroidTools.AndroidLogger.LogError(String task, String format, Object[] args) in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AndroidLogger.cs:line 63
   at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass118_0.<RunShellCommandAsync>b__0() in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 1012

Metadata

Metadata

Labels

needs-triageIssues that need to be assigned.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions