Forum Xamarin Xamarin.iOS

Unable to build for iPhone, can build for iPhoneSimulator

braderbrader USMember ✭✭

I'm unable to build my Xamarin.Forms iOS app when I set my platform to iPhone rather than iPhoneSimulator. I also have an Apple Watch project. I have no issue building, codesigning, and running the app when I select iPhoneSimulator, but when I select iPhone, the build seems to hang for an extremely long time and eventually fails.

I can reliably reproduce this error. There is a diagnostic build log attached for a separate attempt, which has the same ClientDisconnectedException. Sometimes I can see that Xamarin Mac Agent has disconnected, but not always. Sometimes I get the error but in VS, it still appears as connected. I'm using an application on my Macbook to keep it from sleeping while performing these builds, so I don't believe that is the issue. If necessary I can provide more logs.

My setup:
Visual Studio Professional 2017
Xamarin iOS on Windows 10 - 10.8.0.174
Xamarin iOS on Mac - 10.8
Xamarin Mac Agent connected over Wifi

Severity    Code    Description Project File    Line    Suppression State
Error       The "MTouch" task failed unexpectedly.
System.AggregateException: One or more errors occurred. ---> Xamarin.Messaging.Exceptions.ClientDisconnectedException: The client build1268BRade has been disconnected while waiting a post response to topic xvs/Build/4.4.0.34/copy-item/Dash.iOS/32ff583%2FSystem.Core.dll.mdb
   at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__23`2.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 194
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__27`2.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__33`1.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 325
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.VisualStudio.Build.BuildClient.<UploadItemAsync>d__22.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\MSBuild\Xamarin.VisualStudio.Build\BuildClient.cs:line 128
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.VisualStudio.Build.BuildClient.<UploadItemAsync>d__21.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\MSBuild\Xamarin.VisualStudio.Build\BuildClient.cs:line 115
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Xamarin.VisualStudio.Build.TaskRunner.<CopyRequiredInputFilesAsync>d__7.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\MSBuild\Xamarin.VisualStudio.Build\TaskRunner.cs:line 159
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Xamarin.VisualStudio.Build.TaskRunner.Run(Task task) in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\MSBuild\Xamarin.VisualStudio.Build\TaskRunner.cs:line 45
   at Xamarin.iOS.Tasks.MTouch.Execute() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\MSBuild\Xamarin.iOS.Tasks\Tasks\MTouch.cs:line 45
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
---> (Inner Exception #0) Xamarin.Messaging.Exceptions.ClientDisconnectedException: The client build1268BRade has been disconnected while waiting a post response to topic xvs/Build/4.4.0.34/copy-item/Dash.iOS/32ff583%2FSystem.Core.dll.mdb
   at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__23`2.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 194
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__27`2.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.Messaging.Client.MessagingClient.<PostAsync>d__33`1.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\Messaging\Xamarin.Messaging.Client\MessagingClient.cs:line 325
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.VisualStudio.Build.BuildClient.<UploadItemAsync>d__22.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\MSBuild\Xamarin.VisualStudio.Build\BuildClient.cs:line 128
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Xamarin.VisualStudio.Build.BuildClient.<UploadItemAsync>d__21.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\MSBuild\Xamarin.VisualStudio.Build\BuildClient.cs:line 115
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Xamarin.VisualStudio.Build.TaskRunner.<CopyRequiredInputFilesAsync>d__7.MoveNext() in C:\d\lanes\4471\3f99c5a7\source\xamarinvs\src\MSBuild\Xamarin.VisualStudio.Build\TaskRunner.cs:line 159<--- Dash.iOS    C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets 747

Posts

  • braderbrader USMember ✭✭

    Took a while for this thread to be approved... So thought I'd mention that just in case it is a Wifi issue, I've bought an ethernet adapter for the Mac and hope to try that once it arrives to see if it fixes the issue.

  • michaelwarnesmichaelwarnes USMember ✭✭
    edited May 2017

    yup i'm getting exactly the same, was ok on vs2015, are you building on a vm by any chance?

  • michaelwarnesmichaelwarnes USMember ✭✭

    any news on this anyone?

  • braderbrader USMember ✭✭
    edited May 2017

    Yes @michaelwarnes, I did get it figured out and as I suspected it was simply a network connectivity issue. I was connecting over Wifi, which would work when building for the simulator, but building for a device took significantly longer and I found that the Wifi connection wasn't cutting it for whatever reason. It would drop every time and I'd lose Xamarin Mac Agent connection during the build, even if I didn't realize it right away. I was using Wifi because my cube only has one ethernet jack, so I just got the networking department to give me an ethernet switch. After that, haven't had any issues at all.

    No, I'm not building on a VM. I have a Win 10 workstation with VS2017 and a MacBook Pro. MBP doesn't even have ethernet, so I had to get an adapter. Sounds like you're not doing it over Wifi then, so sorry if my post doesn't help at all.

  • michaelwarnesmichaelwarnes USMember ✭✭

    strangely it turned out to be my network connection too! although. It was the last thing I thought of checking as i'm building on a vm on hosted on a MBP. But thx for the info. It just goes to show!

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    I didn't try with the simulator, but it sounds like the bug I filed.

Sign In or Register to comment.