Bug 22138 - Impossible to run 64bit app on simulator
Summary: Impossible to run 64bit app on simulator
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Tools ()
Version: master
Hardware: PC Mac OS
: High major
Target Milestone: 8.0.0 (iOS 8)
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-08-15 17:37 UTC by Rustam Zaitov
Modified: 2014-09-04 10:55 UTC (History)
8 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 or GitHub 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 FIXED

Description Rustam Zaitov 2014-08-15 17:37:36 UTC
I ported sample to build and run on 64 bit platform.
I set target as "iPad Retina (64-bit) iOS8". But I got the follow:
error MT0036: Cannot launch a 32 bits simulator for a 64 bits app. Please enable the correct architecture(s) in your project's iOS Build options (Advanced page).

Sample: https://github.com/xamarin/private-samples/tree/10b00496d13e8e3241816f24e3b82f099290210d/ios8/PhotoFilter
About XS: https://gist.github.com/rzaitov/49ae025d286639bdfe10
Comment 1 Jeffrey Stedfast 2014-08-15 18:45:48 UTC
How are you even building this? There's no way to build a 64-bit iOS8 app right now. Sebastien is still working on merging the branches to make this possible.

That said, your project imports were wrong. I'm not sure if that was the problem or not, but by importing Xamarin.MonoTouch.CSharp.targets, you'd get a 32-bit build.

That's probably how it built and also probably why you got the error :-)
Comment 3 Vincent Dondain [MSFT] 2014-08-21 12:28:58 UTC
This bug is still happening for me so I'm reopening it.

========================================

Xamarin Studio
Version 5.3 (build 427)
Installation UUID: 145b5200-de94-4a06-b034-848d653982c3
Runtime:
	Mono 3.8.0 ((no/62a857e)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000007

Apple Developer Tools
Xcode 6.0 (6256.16)
Build 6A280e

Xamarin.iOS
Version: 7.99.4.26 (Business Edition)
Hash: 3d73d61
Branch: 
Build date: 2014-08-20 15:02:12-0400

Xamarin.Android
Version: 4.17.0 (Business Edition)
Android SDK: /Users/Vince/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0.3 (API level 15)
		4.4   (API level 19)
Java SDK: /usr
java version "1.8.0_20-ea"
Java(TM) SE Runtime Environment (build 1.8.0_20-ea-b23)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b22, mixed mode)

Xamarin.Mac
Version: 1.11.0.1 (Business Edition)

Build Information
Release ID: 503000427
Git revision: b731d769195292820b25b6f9621a7a9decb3fff6
Build date: 2014-08-14 03:26:41-04
Xamarin addins: aaf33dfafebf0d688f6e1a1eb58bced21de89a1d

Operating System
Mac OS X 10.10.0
Darwin iMac.local 14.0.0 Darwin Kernel Version 14.0.0
    Sat Aug  9 00:14:02 PDT 2014
    root:xnu-2782.1.80~2/RELEASE_X86_64 x86_64
Comment 4 GouriKumari 2014-08-21 12:42:06 UTC
Updates to Comment #3:

I tried building a magic-type sample (HelloWorld) against  7.99.4.26 as a 64 bit compatible app, but the app failed to launch on a 64 bit device with architecture not supported error.

Build Log: https://gist.github.com/GouriKumari/36eb913c05566b60e3d9
Error Log: 
error MT1006: Could not install the application '/Users/gourikumari/GitRepo/monotouch-samples/HelloWorld_iPhone/bin/iPhone/Debug/HelloWorld_iPhone.app' on the device XQAiPhone51: AMDeviceSecureTransferPath returned: 0xe8000087 (kAMDIncorrectArchitectureError).
The application was terminated by a signal: SIGHUP

Device: iPhone 5S, 6.1.4

Test Env:
Xamarin Studio
Version 5.3 (build 423)
Installation UUID: 5ed3a124-4b77-4c6f-beb9-c830fd815e2a
Runtime:
	Mono 3.6.0 ((no/832545c)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 306000042

Apple Developer Tools
Xcode 6.0 (6256.16)
Build 6A280e

Xamarin.Mac
Version: 1.10.0.7 (Enterprise Edition)

Xamarin.iOS
Version: 7.99.4.26 (Enterprise Edition)
Hash: 3d73d61
Comment 5 Sebastien Pouliot 2014-08-21 13:02:37 UTC
That bug initial description was: "Impossible to run 64bit app on simulator". IOW not device. 

Please do not re-open bugs unless the exact same conditions happens. When you have a different issue open a new bug.
Comment 6 GouriKumari 2014-08-21 13:11:08 UTC
It was my mistake that I added comment #4 to the same bug. Also, that comment is invalid since I was testing with an iPhone5 6.1.4 device and not an iPhone5S.

However, this bug is still valid for simulator. Vincent opened this bug  after trying to deploy a 64 bit app on a 64 bit simulator. Therefore, I am changing this bug back to "Reopened" status. I apologize for the confusion caused.
Comment 7 Sebastien Pouliot 2014-08-21 13:19:53 UTC
@Vincent I want to see both your build log (add -v -v -v -v) and the application output.
Comment 8 Vincent Dondain [MSFT] 2014-08-21 13:52:07 UTC
Build log and application output: https://gist.github.com/XVincent/4a349d51ab75315996ef

I used iPhone Retina 4 inch 64 bit iOS 8 simulator.
Comment 9 Vincent Dondain [MSFT] 2014-08-21 15:39:31 UTC
I change the status to CONFIRMED.
Comment 10 Vincent Dondain [MSFT] 2014-08-21 17:47:19 UTC
So this bug only happen with Xcode6 (I only tested that with the Beta 6 version). With Xcode5 everything works well.
Comment 11 Sebastien Pouliot 2014-08-21 19:41:53 UTC
From Xcode release notes:

Renaming Xcode.app after running any of the Xcode tools in that bundle may cause the iOS simulator to be no longer available. (16646772)

Workaround: Rename Xcode.app back to what it was when first launched or reboot your Mac.


Your build logs shows you're using Xcode.app, not the default Xcode6-Beta6.app. Can you renamed it back (or reboot).

Note: I'm getting a different error (w/beta 6) on my own projects (and XS 5.4 becomes unusable after it) so I'm not sure it works (yet)
Comment 12 Vincent Dondain [MSFT] 2014-08-22 10:15:51 UTC
Here are my build logs: https://gist.github.com/XVincent/56d97bc99900d3548158

It says I use Xcode6-Beta6 but I still have the same error: 
error MT0036: Cannot launch a 32 bits simulator for a 64 bits app. Please enable the correct architecture(s) in your project's iOS Build options (Advanced page).
Comment 13 Jeffrey Stedfast 2014-08-25 15:21:40 UTC
Vincent: the error you are getting is that you are trying to launch a 64-bit app on a 32-bit simulator.

You need to select the 64-bit simulator to run the app on.
Comment 14 Rustam Zaitov 2014-08-25 16:01:04 UTC
What?
If I build with unified API I must be able run app both on simulator 32bit and simulator 64bit. Issue about the follow: I build with unified API then select 64 bit simulator and get this error.

But I think I know the cause of issue – we need to verify targets. Because we started to port samples without IDE support and now our sample have incorrect targets.

The follow is the Jeff explanation about targets:
1. If the iOS 8 sample is using the Unified API, then it should import a Xamarin.iOS.*.CSharp.targets file:
 a) if the project is an App Extension, it should import Xamarin.iOS.AppExtension.CSharp.targets
 b) else, it should import Xamarin.iOS.CSharp.targets

2. If the iOS 8 sample is using the Classic API, then you should import Xamarin.MonoTouch.CSharp.targets (Note: you cannot make App Extension projects using the Classic API and realistically, all iOS 8 samples should probably use the Unified API)
Comment 15 Rustam Zaitov 2014-08-25 16:51:58 UTC
Sorry, but the suggestion above doesn't work for me.
I still get this error.

Updated sample
https://github.com/xamarin/private-samples/tree/88bc3c8c76d2b9776cc89b9a9113bc5bc63b89b9/ios8/PhotoFilter

About XS: https://gist.github.com/rzaitov/dab8ff4a2ae4fe06c612
Comment 16 Vincent Dondain [MSFT] 2014-08-25 16:56:45 UTC
Doesn't work for me either:

In my csproj file I changed:

<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.MonoTouch.CSharp.targets" />

By:

<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.Xamarin.iOS.CSharp.targets" />

And it doesn't fix anything.
Comment 17 Jeffrey Stedfast 2014-08-25 17:17:56 UTC
Rustam:

These changes probably won't fix whatever this bug is for you, but your project files are broken.

For Unified App projects, make sure that the ProjectTypeGuids look like this:

<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>

For Unified App Extension projects, make sure they look like this:

<ProjectTypeGuids>{FEACFBD2-3405-455C-9665-78FE426C6842};{EE2C853D-36AF-4FDB-B1AD-8E90477E2198};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Comment 18 Vincent Dondain [MSFT] 2014-08-25 17:19:27 UTC
Sorry it's indeed:

<Import
Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets"
/>

(not Xamarin.Xamarin)
Comment 19 Sebastien Pouliot 2014-08-26 18:25:53 UTC
Fixed in ios8-7.4.0 / b7ef23f74c3873fc1658c61c14da01b1ab10aa66

Note that using a FAT app (both arch) should let you use the XS combo box to select which arch to execute
Comment 20 Sebastien Pouliot 2014-08-26 18:28:11 UTC
conflict, revision will be 5c46234c41fef446ca260b9eb9ab73f013c09847
Comment 21 Ram Chandra 2014-09-04 10:55:25 UTC
To verify this issue, I have reproduce this issue with following builds:

Mac OS X 10.9.4
XS 5.4 (build 184)
Xcode 6.0 
Mono 3.8.0 ((no/356dbc5)
Xamarin.iOS: 7.9.4.22
Build Information
Release ID: 504000184
Git revision: 8c98fc4b6482790b1d585ff8a4118a08367e417c
Build date: 2014-09-02 13:05:53-04
Xamarin addins: 00e7f8c87574ac8606d18bbb0df49bf717c9b756

With the above build on running the application with 64 bit simulator, I am getting following error:

"Eror MT0036: Cannot launch a 64 bits simulator for a 32 bits app. Please
enable the correct architecture(s) in your project's iOS Build options
(Advanced page)."

To verify this issue, I have checked this issue with following builds:

Mac OS X 10.9.3
Xamarin Studio: 5.4 (build 193)
Mono 3.8.0 ((no/62a857e)
Xcode 6.0 (6256.16)
Xamarin.iOS: 7.9.4.29 
Build Information
Release ID: 504000193
Git revision: 46066435cc7aa39d3d0828604a811b1dbf887a89
Build date: 2014-09-04 07:47:38-04
Xamarin addins: d815976eecec2d2d4b3778a55123ac775663fb8c

When I run the iOS "Single View Application" of unified API on 64 bit
simulator, I am not getting any error message and I am able to run the
application on 64 bit simulator.

This issue has been fixed. As per now, I am closing this issue.

Please let me know if I have to check anything else to verify this issue.