Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numerous Exceptions While Attaching Debugger #18783

Closed
Mike-E-angelo opened this issue Nov 13, 2024 · 2 comments
Closed

Numerous Exceptions While Attaching Debugger #18783

Mike-E-angelo opened this issue Nov 13, 2024 · 2 comments
Labels
area/external Categorizes an issue or PR as being external to the Uno

Comments

@Mike-E-angelo
Copy link

Current behavior

I am using a very basic and simple SLN:
https://github.com/unoplatform/Uno.Samples/blob/master/reference/Counter/XAML-MVVM/Counter-XAML-MVVM.sln

While pressing F5 to launch the application into an Android emulator, I am finding that it works as expected 1 out of 10 times. Most of the time the emulator sits there waiting to be attached:

image

But other times there are errors:

 warning: Could not connect Jdwp. System.Exception: Process Not Found.
   at Xamarin.AndroidTools.Debugging.DebuggingExtensions.<ConnectJdwpAsync>d__8.MoveNext() in D:\a\_work\1\s\External\androidtools\Xamarin.AndroidTools\Debugging\DebuggingExtensions.cs:line 198
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidTools.Debugging.DebuggingExtensions.<StartWithDebuggingAsync>d__2.MoveNext() in D:\a\_work\1\s\External\androidtools\Xamarin.AndroidTools\Debugging\DebuggingExtensions.cs:line 63

And:

> warning: Could not connect Jdwp. System.ObjectDisposedException: Cannot access a disposed object.
Object name: 'AdbClient'.
   at Mono.AndroidTools.Adb.AdbClient.CheckDisposed() in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\Adb\AdbClient.cs:line 104
   at Mono.AndroidTools.Adb.AdbClient.CreateClient() in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\Adb\AdbClient.cs:line 96
   at Mono.AndroidTools.Adb.AdbClient.BeginConnect(AsyncCallback callback, Object state) in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\Adb\AdbClient.cs:line 128
   at System.Threading.Tasks.TaskFactory`1.FromAsyncImpl(Func`3 beginMethod, Func`2 endFunction, Action`1 endAction, Object state, TaskCreationOptions creationOptions)
   at Mono.AndroidTools.Internal.AdbClientTaskExtensions.ConnectAsync(AdbClient client, TaskCreationOptions options) in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\Internal\AdbClientTaskExtensions.cs:line 50
   at Mono.AndroidTools.AdbServer.RunCommandWithStatus(String command, CancellationToken cancellationToken)
   at Mono.AndroidTools.AdbServer.KillForward(AndroidDevice device, String localProtocol, Int32 localPort, CancellationToken cancellationToken) in D:\a\_work\1\s\External\androidtools\Mono.AndroidTools\AdbServer.cs:line 202
   at Xamarin.AndroidTools.Debugging.DebuggingExtensions.<ConnectJdwpAsync>d__8.MoveNext() in D:\a\_work\1\s\External\androidtools\Xamarin.AndroidTools\Debugging\DebuggingExtensions.cs:line 196
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.AndroidTools.Debugging.DebuggingExtensions.<StartWithDebuggingAsync>d__2.MoveNext() in D:\a\_work\1\s\External\androidtools\Xamarin.AndroidTools\Debugging\DebuggingExtensions.cs:line 63

Also, it takes nearly 100 seconds from pressing F5 to seeing the very basic application load in the Android emulator. This seems like a really long time.

Expected behavior

Pressing F5 quickly launches the application without error.

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

No response

Works on UWP/WinUI

None

Environment

No response

NuGet package version(s)

No response

Affected platforms

Android

IDE

Visual Studio 2022

IDE version

17.12

Relevant plugins

No response

Anything else we need to know?

Thank you for your efforts out there. :)🙏

@Mike-E-angelo Mike-E-angelo added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Nov 13, 2024
@jeromelaban
Copy link
Member

Thanks for the report. Those issues are coming from Visual Studio, it would be best for your to open an issue directly here: https://developercommunity.visualstudio.com/VisualStudio.

Are you able to reproduce the same behavior using vscode?

@jeromelaban jeromelaban added area/external Categorizes an issue or PR as being external to the Uno triage/needs-information Indicates an issue needs more information in order to work on it. and removed kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Nov 18, 2024
@Mike-E-angelo
Copy link
Author

I appreciate your patience here @jeromelaban as I learn all the moving pieces. I was indeed also encountering this with Maui and this appears to be Visual Studio-related. Taking this off your plate. I appreciate all your efforts and impressive accomplishments out there. 🙏

@github-actions github-actions bot removed the triage/needs-information Indicates an issue needs more information in order to work on it. label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/external Categorizes an issue or PR as being external to the Uno
Projects
None yet
Development

No branches or pull requests

2 participants