Bug 52359 - Error: The post for client vs[CODE] on topic xvs/idb/[XAMARIN VERSION]/launch-app has been cancelled
Summary: Error: The post for client vs[CODE] on topic xvs/idb/[XAMARIN VERSION]/launch...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 4.3.0 (C9)
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-02-07 14:24 UTC by Rob Houweling
Modified: 2017-08-17 07:06 UTC (History)
13 users (show)

Is this bug a regression?: ---
Last known good build:

The App causing crash during launch (2.95 MB, application/x-zip-compressed)
2017-02-14 21:28 UTC, Attila Tamás Zimler
The logs generated with devenv.exe /log and zipped from Help > Xamarin (16.25 KB, application/x-zip-compressed)
2017-02-14 21:29 UTC, Attila Tamás Zimler
xamarin log1 (433.08 KB, application/octet-stream)
2017-02-16 11:47 UTC, Rob Houweling
Log file 2 (307.64 KB, application/octet-stream)
2017-02-16 11:47 UTC, Rob Houweling
log from visual studio (23.10 KB, application/x-zip-compressed)
2017-05-16 08:56 UTC, Fabio

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Rob Houweling 2017-02-07 14:24:48 UTC
Sometimes the following error occurs when trying to run an app on an iPhone (experienced on iOS10, iPhone SE):
"Launch failed. The app '[APPNAME]' could not be launched on '[DEVICE NAME]'. Error: The post for client vs[SOME CODE] on topic xvs/idb/[XAMARIN VERSION]/launch-app has been cancelled. Please check the logs for more details.
The app has been terminated."

Overview: When debugging or launching an app from Visual Studio 2015 sometimes the error above occurs. When it occurs, it doesn't help to clean or rebuild or something like that. Only thing that helps as far as I've seen is to restart Visual Studio.

Steps to Reproduce: This ones a bit difficult because it only happens once in a while. But according to the forum this happens with multiple users.

Expected Results: The app is started on the iPhone without restarting Visual Studio first.

Build Date & Hardware: 
Windows 10 Version 1607 (Build 14393.693),
Visual Studio 2015 Version 14.0.25431.01 Update 3
macOS Sierra Version 10.12.3
XCode Version 8.2.1 (8C1002)

Additional Information: Also see:
Comment 1 mag@xamarin.com 2017-02-08 15:22:20 UTC
Hi Rob,

It would be really helpful if you can attach the verbose logs of the IDB Agent on the Mac, given that it looks like the Agent is the one having problems with the launch operation when this happens. The cancellation in VS looks like a consequence of the problem on the IDB Agent on the Mac.

To have logs with diagnostics verbosity, please start Visual Studio with the /log argument: devenv.exe /log

Then, to get the IDB logs of the current session, please ensure that you got the failure scenario and then, while still connected to the Mac, do any of these two things:

- Automatically with VS in Windows: Help > Xamarin > Zip Logs...
- Manually in the Mac: Go to ~/Libary/Logs/Xamarin-<version> and get the IDB.log and IDB.stderr.log of the corresponding session (usually the latest modified log file)

Then please attach a .zip with the logs in this bug.
Thanks in advanced,
Comment 2 Rob Houweling 2017-02-09 08:23:57 UTC
Hi Mauro,

I'll try to get them to you as soon as possible.

Comment 3 Attila Tamás Zimler 2017-02-14 21:28:16 UTC

I've had a similar issue recently with a freshly generated Single View App, and looking for the different parts of the error message led me to this ticket. I've managed to track it down in my case to the difference that I'm building the project for iPhoneSimulator 5 iOS 10.2 (crashing) or iPhone SE iOS 10.2 (launching). I know that the original bug reporter experienced the problem on iPhone SE, but my additional information might help solving the problem.

The steps that I took to verify were:
- Successfully able to run https://github.com/xamarin/ios-samples/tree/master/Calendars, Latest commit e36a9a8. Interestingly this app, launches in both configuration, but its structure in the AppDelegate.cs is slightly different than the structure of the Single View Template.

- Generated the template on both Xamarin Studio on the Mac and VS on the Windows (both had the error).

- Xamarin Studio on Mac is also crashing on the iPhone 5 Simulator.

- I used Debug builds.

Software versions:
On the PC:
Windows 10 Pro Version 1607 (OS Build 14393.447)
Visual Studio Version 14.0.25431.01 Update 3 Community 2015
Microsoft .NET Framework 4.6.01586
Xamarin (00fa5cc)
Xamarin iOS (7beaef4)

On the Mac:
macOS Sierra Version 10.12.1
Xcode Version 8.2.1 (8C1002)
Simulator Version 10.0 (SimulatorApp-726.7)
Xamarin Studio Community Version 6.1.5 (build 0)


Comment 4 Attila Tamás Zimler 2017-02-14 21:28:58 UTC
Created attachment 19819 [details]
The App causing crash during launch
Comment 5 Attila Tamás Zimler 2017-02-14 21:29:54 UTC
Created attachment 19820 [details]
The logs generated with devenv.exe /log and zipped from Help > Xamarin
Comment 6 Rob Houweling 2017-02-16 10:37:36 UTC
Thanks Atilla. I haven't been able to reproduce the error since I haven't worked on the iPhone app in a while.
@Mauro, please let me know if you still need my logging since you've already received the ones from Atilla.

Kind regards,

Rob Houweling
Comment 7 Rob Houweling 2017-02-16 11:47:25 UTC
Created attachment 19843 [details]
xamarin log1

Log file 1
Comment 8 Rob Houweling 2017-02-16 11:47:55 UTC
Created attachment 19844 [details]
Log file 2

Log file 2
Comment 9 Rob Houweling 2017-02-16 11:48:49 UTC
Needed to make some changes to the iOS app and encountered the problem fairly quickly. Added 2 logfiles of both occurrences so far.

Kind regards,

Rob Houweling
Comment 10 Fabio 2017-05-16 08:55:07 UTC
Same problem for me, how to fix? 

Xamarin.VisualStudio.IOS.IdbClient|Error|0|Launch failed. The app 'FMC.PatApp.iOS' could not be launched on 'iPhone 6s iOS 10.3'. Error: An error occurred while executing MTouch. Please check the logs for more details.
Xamarin.Messaging.Exceptions.MonotouchException: An error occurred while executing MTouch
  at Xamarin.Messaging.IDB.MTouch+<RunAsync>d__8.MoveNext () [0x0023d] in <498da94e23d24b8f9254fbc02791391e>:0 
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/exceptionservices/exceptionservicescommon.cs:151 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x00037] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:187 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:156 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:128 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/TaskAwaiter.cs:535 
  at Xamarin.Messaging.IDB.MTouch+<RunAsync>d__7.MoveNext () [0x00080] in <498da94e23d24b8f9254fbc02791391e>:0 
--- End of stack trace from previous location where exception was thrown ---
Comment 11 Fabio 2017-05-16 08:56:08 UTC
Created attachment 22188 [details]
log from visual studio
Comment 12 Adrian Alonso 2017-06-21 19:14:15 UTC
Thanks for the logs and info. We will take a look at it and try to reproduce the issue on our side.
Comment 13 Jimmy [MSFT] 2017-07-12 18:13:17 UTC
Hi all! Are you still seeing this happen with the latest Xamarin versions? While I was not able to reproduce the issue where the app would not launch, I did notice that my logs would show

>  Launch failed. The app 'App1' could not be launched on 'iPhone 5s iOS 10.3'. Error: An error occurred while executing MTouch. Please check the logs for more details.

every time I terminated the debugging session in Visual Studio. This only happened when debugging on a simulator, not a device. In the forum post mentioned in the the description, they said that the app launches and debugs successfully the first time but fails on subsequent tries. Is this the same behavior you experience when you run into this issue?

It also sounds like this happens on some simulators, not necessarily all of them or even the same ones for each user. In this case, with the problem simulator open, can you go to "Simulator > Reset Content and Settings" to see if it helps? 

Comment 14 Prashant [MSFT] 2017-08-17 07:06:16 UTC
Because we have not received a reply to our request for more information, we are marking this issue as RESOLVED→NORESPONSE. If you are still encountering this issue on the latest Visual Studio 2017 Preview version 15.3, please don’t hesitate to reopen the ticket with the requested information.