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
- Open any Xamarin Forms Android project
- In Project Properties --> Android Options, make sure "Fast Deploy" is disabled
- 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
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
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:
Xamarin Diagnostics Output