Workbooks for Android unable to connect to the emulator.

Hi,
any android workbook fails on my VS android emulator with message 'Unable to connect'. As seen in the log it doesn't even install the workbook app. The emulator starts successfully though.

[Info][00:00:00.0079998] AppSession (.ctor): Starting Xamarin Inspector client @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\AppSession.cs:50
[Info][00:00:01.1564999] MessageViewController (LogMessage): PushMessage => Status: Loading workbook… @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Messages\MessageViewController.cs:98
[Info][00:00:01.2385002] UpdaterService (CheckForUpdatesInBackground): checking for updates @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Client\Updater\UpdaterService.cs:61
[Info][00:00:01.3664993] MessageViewController (LogMessage): PushMessage => Status: Loading workbook… @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Messages\MessageViewController.cs:98
[Info][00:00:01.5340003] MessageViewController (LogMessage): PushMessage => Status: Loading workbook… @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Messages\MessageViewController.cs:98
[Info][00:00:01.9565005] MessageViewController (LogMessage): PushMessage => Status: Loading workbook… @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Messages\MessageViewController.cs:98
[Info][00:00:02.0525004] MessageViewController (LogMessage): PushMessage => Status: Loading workbook… @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Messages\MessageViewController.cs:98
[Info][00:00:03.2075395] UpdaterService (CheckForUpdatesInBackground): no updates are available @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Client\Updater\UpdaterService.cs:70
[Info][00:00:03.5440398] MessageViewController (LogMessage): PushMessage => Status: Connecting to agent… @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Messages\MessageViewController.cs:98
[Info][00:00:06.9903558] MessageViewController (LogMessage): PushMessage => Status: Finding Android device… @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Messages\MessageViewController.cs:98
[Info][00:00:06.9983547] MessageViewController (LogMessage): PushMessage => Status: Launching Android workbook app… @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Messages\MessageViewController.cs:98
[Error][00:00:07.0098580] AgentProcessManager (StartAsync): StartAsync: Mono.AndroidTools.AdbException: closed
w Mono.AndroidTools.Util.AggregateAsyncResult.CheckError(CancellationToken token)
w System.Threading.Tasks.TaskFactory1.FromAsyncCoreLogic(IAsyncResult iar, Func2 endFunction, Action1 endAction, Task1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
w System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
w Xamarin.Interactive.Client.AgentProcesses.AndroidAgentProcess.d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
w System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
w Xamarin.Interactive.Client.AgentProcesses.AndroidAgentProcess.d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
w System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
w System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
w Xamarin.Interactive.Client.AgentProcesses.AgentProcessManager`1.d__16.MoveNext() @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Client\AgentProcesses\AgentProcessManager.cs:235
[Error][00:00:07.0123623] MessageViewController (LogMessage): PushMessage => Alert: Unable to connect (closed) @ C:\Users\builder\data\lanes\1661\1f3067d3\source\inspector\Clients\Xamarin.Interactive.Client\Messages\MessageViewController.cs:98

Best Answer

Answers

  • prashantvcprashantvc USXamarin Team Xamurai

    Make sure you are using the Google Android Emulator, Visual Studio Android Emulator, or Xamarin Android Player, and have an Android 4.4 (or newer) device set up in that emulator.

    Other Android emulators are not supported at this time.

  • wvdbrwvdbr PLMember

    As I've written above, I'm using Visual Studio Android Emulator. Xamarin Studio and Visual Studio deploys applications to it without any problems. It seems that workbook can't even deploy Workbooks app/agent to the emulator.

  • SandyArmstrongSandyArmstrong USXamarin Team, Insider Xamurai

    What version of Android is your emulator?

    Have you tried the following steps to see if your Hyper-V network needs repair? https://developer.xamarin.com/guides/cross-platform/workbooks/troubleshooting/#Visual_Studio_Android_Emulator_cannot_connect_to_internet

  • DanVDDanVD ZAMember

    Hi.
    This screenshot is proof of API-23 level for Android device being able to connect to agent for Xamarine workbook.

    https://photos.google.com/photo/AF1QipOfqK7tT7XXJxac_8AllQUxltYM4cOeFG0zmLU7

  • wvdbrwvdbr PLMember

    @SandyArmstrong
    I've read the thread you linked, but didn't try out those suggestions, because I had normal access to the web inside the emulator. I was using default profile installed with VS emulator for Android: 5" KitKat (4.4) XXHDPI, API Level 19.

    @DanVD
    Thanks for the suggestion, Xamarin agent starts successfully on a API-23 profile. Workbooks work too now. I still have some problems with invalid Nuget package in one of the Xamarin.Forms workbooks, but that's different thing.

Sign In or Register to comment.