Bug 13743 - Cannot launch app on iPad
Summary: Cannot launch app on iPad
Status: VERIFIED NOT_REPRODUCIBLE
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 1.2.x
Hardware: PC Windows
: High major
Target Milestone: ---
Assignee: Martin Baulig
URL:
: 16907 ()
Depends on:
Blocks:
 
Reported: 2013-08-05 04:11 UTC by max.vn.info
Modified: 2015-08-11 10:52 UTC (History)
11 users (show)

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

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:
Status:
VERIFIED NOT_REPRODUCIBLE

Description max.vn.info 2013-08-05 04:11:45 UTC
I am developing an app with Xamarin.iOS 6.4 and MvvmCross. I use PCL with async/await.
When I try to launch my app on iPad, the build stop and the debug output disply this : 
    
    Failed to load AOT module '<my PCL>' while running in aot-only mode: doesn't match assembly.

And if I click on my app icon on the device,a black screen appear and disappear immediately.
Comment 1 Zoltan Varga 2013-08-06 04:03:13 UTC
The error message means the assembly in the .app is not the same assembly which was compiled by the AOT compiler, so this is most likely some kind of problem with mtouch.
Comment 2 Michael James 2013-08-09 11:22:47 UTC
I also have this and have reported to support.

Do you require any MTBS logs?
Comment 3 Dominique Louis 2013-08-09 11:58:34 UTC
Hi Max,
  If you copy that code over to your Mac and build the project using Xamarin Studio, do you get the same error?
Comment 4 Michael James 2013-08-09 12:05:40 UTC
Hi Dominique,

Thought I'd add my two cents as I have had this for a week or so. I have never had the issue in Xamarin Studio just VS. 

My workaround is to always delete the contents of the mtbs folder on the Mac every build so it effectively avoids using any cache, its a pain to do but the error never occurs if you do that. However if I leave the folders, make a change, rebuild and deploy the error occurs every time.
Comment 5 Dominique Louis 2013-08-09 12:10:00 UTC
OK, thanks for the clarification Michael.
Comment 10 Hugo 2014-02-10 23:54:43 UTC
*** Bug 16907 has been marked as a duplicate of this bug. ***
Comment 11 ilya.golovach 2014-10-04 18:54:57 UTC
I am not sure if this issue is still present in latest version, but I have it in 7.0.6.168 and here is my workaround.

I have found that cleaning solution before compiling is required in vast majority of cases if you make any modification to the code. Triggering cleaning from inside VS also sends similar command to mac build host. This step appeared to be crucial because removing all files just on Windows machine did not fix the issue. However, it happened that only few files are responsible for this issue. Which files depends on what kind of build you are using:

1) Incremental build (without linking):

/Users/<username>/Library/Caches/Xamarin/mtbs/builds/<project name>/<some hash>/output/temp/mtouch-cache/<project name>.exe.armv7.s

2) Not incremental build (with SDK linking only)

/Users/<username>/Library/Caches/Xamarin/mtbs/builds/<project name>/<some hash>/output/temp/mtouch-cache/Build/monotouch.dll

There are 2 ways to avoid the issue. Either not to forget to clean the project each time or delete those files before each build. Second approach can be made automatic.

1) Enable SSH daemon on Mac. Go to System preferences>Sharing and enable remote login.

2) Download Putty on windows machine. There is several ways how to connect to you Mac, but I can suggest to open putty.exe and create login configuration there and save it under some name (do not forget to provide default username).

3) Enter pre-build event command for your project. It will look something like this

<path to putty directory>\plink.exe -load "<name of your saved configuration from step 2>" -m "$(SolutionDir)build_host_cleanup.txt"

4) build_host_cleanup.txt from previous step contains remote command. We want to delete concrete file, thus the contents of this text file will me something like this

rm -f /Users/<username>/Library/Caches/Xamarin/mtbs/builds/<project name>/<some hash>/output/temp/mtouch-cache/<project name>.exe.armv7.s

5) to make everything working you should also either create private/public keys and save it in the configuration (like I did) or you can add password to the command line (well, this is in case your mac has password). It later case your command line will look like

<path to putty directory>\plink.exe -load "<name of your saved configuration from step 2>" -pw <your password> -m "$(SolutionDir)build_host_cleanup.txt"

Here is quick tutorial on how to create keys https://cs.uwaterloo.ca/cscf/howto/ssh/public_key/#putty
Comment 12 Ian Ceicys 2015-07-10 11:39:51 UTC
Hello ilya, I am following up on this bug and attempting to reproduce the issue with the latest stable build of our Xamarin Visual Studio product (3.11.666) and so far I have been unable to reproduce the issue. 

http://developer.xamarin.com/releases/vs/xamarin.vs_3/xamarin.vs_3.11/

Please try to upgrade to the latest stable XVS build and if you are still experiencing the same problem please reply and I'd be more than happy to setup a screen sharing session to further debug the issue.

For other folks experiencing this issue please see if in Visual Studio cleaning the solution before compiling resolves the problem.

At this time, I am going to update this bug to be "NeedInfo" as I need additional information on the installed Xamarin version and the Xamarin logs.
Comment 13 Ian Ceicys 2015-07-17 08:34:20 UTC
Hello ilya, I am following up again on this bug and attempting to reproduce the issue
with the latest stable build of our Xamarin Visual Studio product (3.11.666)
and so far I have been unable to reproduce the issue. 

Please try to upgrade to the latest stable XVS build and if you are still
experiencing the same problem please reply and I'd be more than happy to setup
a screen sharing session to further debug the issue.
Comment 14 Akhilesh kumar 2015-08-11 10:52:37 UTC
As we are not getting any response on this bug. So I am closing this issue.

Please feel free to reopen it again, if any one still facing this issue.