Cannot launch Xamarin.iOS app on device
Asked Answered
S

7

11

I am developing an iPad application with Xamarin.iOS and MVVMcross. So I have a PCL with my View-Model and my Model, and an iOS project with the view. I use Visual Studio.

Before, I used Xamarin.iOS 6.3.6 beta version, and when I tried to launch the app on the device, an .app file was created and getting it with my Ipad, I could launch the application (impossible to launch directly from Visual Studio).

Yesterday, I uploaded Xamarin.iOS to 6.4.1. On simulator, everything's okay. When I try to launch the application on device, now the app is directly installed but the build stop and the following error appear in the debug output :

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.

Does someone know why this error appear?

Sewell answered 1/8, 2013 at 13:21 Comment(0)
B
21

This looks like something was cached somewhere or not updated correctly.

Here are a few ideas to try:

  • Delete the app from the device.
  • Clean & Rebuild your app.
  • Build & install from Xamarin Studio on your Mac.
  • Copy the Debug configuration to a new configuration (DebugTest for instance), and run that configuration instead.
Blume answered 1/8, 2013 at 16:22 Comment(1)
Then I suggest you file a bug at bugzilla.xamarin.com with your project so we can have a look at it.Blume
P
8

I regularly get the same issue here.

The workaround that I use is to switch the platform in the Visual Studio build Configuration Manager to "iPhoneSimulator", run a quick debug session on that, then switch the platform back to "iPhone", and the problem disappears for a while.

Unfortunately I have no intelligent reason as to why this works. It seems to be doing a better job of the "Clean and Rebuild".

Pastelist answered 29/9, 2013 at 21:52 Comment(1)
The same worked for me on macOS 10.12.5 with Visual Studio for Mac 7.1 build 583.Iconic
M
3

After reading a similar bug, I found that clearing the mtbs folder on the OS X host which is located at $HOME/Library/Caches/Xamarin/mtbs/ fixes this problem for me.

I have to do it so frequently I just have a PuTTY session open on my Windows box to clear the folder. I do hope that Xamarin fixes this issue soon.

Millais answered 10/10, 2013 at 15:31 Comment(2)
After updating to the latest version of the software, I no longer have to do this.Millais
I didn't have this path with Xamarin Studio 5.5.4, but I have a directory that looked very similar at ~/Library/Caches/XamarinStudio-5.0/DerivedData/.Repository
V
3

Make sure Linker Behaviour is set to Don't Link

Clean, rebuild, remove old version from app.

Worked for me at least.

Vincentia answered 30/1, 2015 at 8:2 Comment(0)
B
1

This happened to me after I upgraded to XCode 5/iOS7. I noticed a warning that I hadn't installed XCode Command Line Tools. After I did that I rebuilt the application and it now runs.

Bay answered 3/10, 2013 at 5:16 Comment(0)
H
0

I just had this problem and got it to work again by opening the Apple project properties and changing the provisioning profile identity from "Distribution" to "Developer".

Holarctic answered 30/6, 2014 at 16:37 Comment(0)
H
0

My workaround on Mac is to

  1. Close Solution in XS
  2. Quit XS. Command-Q
  3. Reopen it and reopen solution.

After that it usually works again.

Hispanic answered 3/12, 2014 at 18:5 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.