This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 44996 - CoreAudioKit.framework crash apps on (some) iOS simulator 8.1
Summary: CoreAudioKit.framework crash apps on (some) iOS simulator 8.1
Status: VERIFIED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: XI 10.0 (iOS10)
Hardware: Macintosh Mac OS
: High major
Target Milestone: (C9)
Assignee: Ivan Herrera
URL:
Depends on:
Blocks:
 
Reported: 2016-10-04 04:49 UTC by ypatil
Modified: 2017-01-06 18:23 UTC (History)
7 users (show)

See Also:
Tags:
Is this bug a regression?: Yes
Last known good build: 9.8.2.22


Attachments

Description ypatil 2016-10-04 04:49:06 UTC
When I debug and deploy Xamarin.iOS native app to iOS simulator 8.1 through XS(in Mac), it installs app to simulator but it closes automatically after installation. Though app deployment on iOS simulator 10 works fine. This problem is occurred after updating XS to latest version and iOS SDK update to latest version. My iOS app deployment target is 8.0. Also I made sure that Entitlements.plist is empty.

NOTE: Xcode 8 does successful installation on iOS simulator 8.1 and works fine.

Anyone knows why this problem occurs and how to resolve it ?
Comment 1 Jeffrey Stedfast 2016-10-04 15:39:43 UTC
You'll need to check your Simulator logs to see what happened.
Comment 2 Timothy Risi 2016-10-04 19:06:35 UTC
This is a regression, the same iOS 8.1 project that crashes on XI 10 runs correctly on XI 9.8.2.22

Console log attempting to launch 8.1 simulator in a freshly created ios app with deployment target set to 8.0:

https://gist.github.com/timrisi/4bbf8eb1068e64077d352d61563b508b
Comment 3 Sebastien Pouliot 2016-10-05 13:32:07 UTC
@Alex can you please compare results and investigate from the above data ? thanks!
Comment 4 Alex Soto 2016-10-05 14:40:57 UTC
A new project works just fine in latest xamarin-macios/master @ d1361d963e86796eaa864fda0c16449b35a037d1
Comment 5 Alex Soto 2016-10-05 20:22:20 UTC
Hello! 

Sorry for the delay, had to install 8.1 simulators and that took ages, I am not able to reproduce this issue with current stable Xamarin (my installation attached).

@ypatil could you provide us your version information? The easiest way to get exact version information is to use the "Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" button and copy/paste the version informations (you can use the 
"Copy Information" button).

@Tim, what version of X.I are you using?

=== Xamarin Studio Enterprise ===

Version 6.1.1 (build 15)
Installation UUID: 48af9690-0e4c-4b21-b82d-5c9cce64d17e
Runtime:
	Mono 4.6.1 (mono-4.6.0-branch-c8sr0/abb06f1) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406010005

=== Apple Developer Tools ===

Xcode 8.0 (11246)
Build 8A218a

=== Xamarin.Mac ===

Version: 2.10.0.105 (Xamarin Enterprise)

=== Xamarin.iOS ===

Version: 10.0.1.10 (Xamarin Enterprise)
Hash: ad1cd42
Branch: cycle8-sr0-xi
Build date: 2016-10-03 15:18:44-0400

=== Build Information ===

Release ID: 601010015
Git revision: fa52f02641726146e2589ed86ec4097fbe101888
Build date: 2016-09-22 08:03:02-04
Xamarin addins: 75d65712af93d54dc39ae4c42b21dfa574859fd6
Build lane: monodevelop-lion-cycle8-sr0

=== Operating System ===

Mac OS X 10.11.6
Darwin iAlexRet.local 15.6.0 Darwin Kernel Version 15.6.0
    Mon Aug 29 20:21:34 PDT 2016
    root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64
Comment 6 Timothy Risi 2016-10-05 22:42:42 UTC
@Alex I'm on current stable.  Single view app, no changes beyond modifying the Deployment Target in the plist to 8.0.  Runs fine on iOS9 or 10, crashes on launch on iPhone 5s simulator on 8.1.

Xamarin Studio Community
Version 6.1.1 (build 15)
Installation UUID: 867dab2a-5981-4fcb-a66d-6f0df3f97a4a
Runtime:
	Mono 4.6.1 (mono-4.6.0-branch-c8sr0/ef43c15) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406010005

NuGet
Version: 3.4.3.0

Xamarin.Profiler
Not Installed

Xamarin.Android
Version: 7.0.1.3 (Xamarin Studio Community)
Android SDK: /Users/Tim/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)
		7.0   (API level 24)

SDK Tools Version: 25.1.7
SDK Platform Tools Version: 24.0.2
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Xamarin Android Player
Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

Apple Developer Tools
Xcode 8.0 (11246)
Build 8A218a

Xamarin.Mac
Version: 2.10.0.105 (Xamarin Studio Community)

Xamarin.iOS
Version: 10.0.1.10 (Xamarin Studio Community)
Hash: ad1cd42
Branch: cycle8-sr0-xi
Build date: 2016-10-03 15:18:44-0400

Build Information
Release ID: 601010015
Git revision: fa52f02641726146e2589ed86ec4097fbe101888
Build date: 2016-09-22 08:03:02-04
Xamarin addins: 75d65712af93d54dc39ae4c42b21dfa574859fd6
Build lane: monodevelop-lion-cycle8-sr0

Operating System
Mac OS X 10.12.0
Darwin Timothys-MacBook-Pro.local 16.0.0 Darwin Kernel Version 16.0.0
    Tue Jul 26 18:32:56 PDT 2016
    root:xnu-3789.1.4.1.1~1/RELEASE_X86_64 x86_64
Comment 7 ypatil 2016-10-06 05:22:11 UTC
@Alex, thanks for such descriptive response. I was busy with my work, hence reply is delayed.

Xamarin detail information:
=== Xamarin Studio Community ===

Version 6.1.1 (build 15)
Installation UUID: 4df1eae6-caed-414c-87b7-c25b43a89089
Runtime:
	Mono 4.6.1 (mono-4.6.0-branch-c8sr0/ef43c15) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406010005

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.0 (11246)
Build 8A218a

=== Xamarin.Mac ===

Version: 2.10.0.105 (Xamarin Studio Community)

=== Xamarin.iOS ===

Version: 10.0.1.10 (Xamarin Studio Community)
Hash: ad1cd42
Branch: cycle8-sr0-xi
Build date: 2016-10-03 15:18:44-0400

=== Xamarin.Android ===

Version: 7.0.1.3 (Xamarin Studio Community)
Android SDK: /Users/gmcs/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		6.0   (API level 23)

SDK Tools Version: 25.2.2
SDK Platform Tools Version: 24.0.3
SDK Build Tools Version: 24

Java SDK: /usr
java version "1.8.0_74"
Java(TM) SE Runtime Environment (build 1.8.0_74-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.74-b02, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Not Installed

=== Build Information ===

Release ID: 601010015
Git revision: fa52f02641726146e2589ed86ec4097fbe101888
Build date: 2016-09-22 08:03:02-04
Xamarin addins: 75d65712af93d54dc39ae4c42b21dfa574859fd6
Build lane: monodevelop-lion-cycle8-sr0

=== Operating System ===

Mac OS X 10.11.6
Darwin GMCSs-Mac-mini.local 15.6.0 Darwin Kernel Version 15.6.0
    Mon Aug 29 20:21:34 PDT 2016
    root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64
Comment 8 ypatil 2016-10-06 05:29:35 UTC
@Jeffrey, I am not sure what to look for in simulator log.
I recovered my simulator logs from location "~/Library/Logs/CoreSimulator/<simulator-hash>/system.log"

You will get iPhone-6 iOS 8.1 simulator logs from DropBox URL:
https://www.dropbox.com/s/2lahqgv8jh2q5xn/system.log?dl=0
Comment 9 Alex Soto 2016-10-06 18:50:43 UTC
@ypatil any chance you could provide us with the simulator crashlog? It should be in this directory ~/Library/Logs/DiagnosticReports/
Comment 10 ypatil 2016-10-07 05:50:41 UTC
@Alex, 
Find simulator crashlog from DropBox URL: https://www.dropbox.com/s/98g0o4q3yxm5bp2/TutorMeNot.iOS_2016-10-07-110728_GMCSs-Mac-mini.crash?dl=0
Comment 11 Alex Soto 2016-10-07 15:00:20 UTC
Hello @ypatil

Before giving you an answer I want to ask you something, are you using CoreAudioKit in your app?
Comment 12 ypatil 2016-10-10 04:36:38 UTC
@Alex, No I am not using any API from CoreAudioKit framework.
The other components that are used in project:
ZXing.Net.Mobile https://components.xamarin.com/view/zxing.net.mobile
SQLite.NET: https://components.xamarin.com/view/sqlite-net
Syncfusion Chart: https://help.syncfusion.com/xamarin-ios/sfchart/overview
Comment 13 Alex Soto 2016-10-10 23:55:38 UTC
@ypatil Any chance you could provide us your full build logs for iOS simulator? (please add -v -v -v -v to additional mtouch args inside your project settings > build > iOS build)
Comment 14 ypatil 2016-10-11 13:01:47 UTC
@Alex, after adding provided additional mtouch args, produced result files are:
System.log: https://www.dropbox.com/s/82r7zixim9fcr37/system.log?dl=0
Crash log: https://www.dropbox.com/s/lct3mkzo2tzwh3d/TutorMeNot.iOS_2016-10-11-180822_GMCSs-Mac-mini.crash?dl=0
Comment 15 Sebastien Pouliot 2016-10-11 18:26:38 UTC
@Ypatil it's not clear why we cannot duplicate this. However it was an issue, with older Xcode, that CoreAudioKit support was missing for the simulator.

> 	/System/Library/Frameworks/CoreAudioKit.framework/CoreAudioKit: mach-o, but not built for iOS simulator

The crash report seems to point to the same issue. I'm fairly sure you can workaround this by enabling the managed linker (i.e. "Link SDK") from your options. As you do not use CoreAudioKit yourself the (managed) linker will eliminate the symbols that refers to your (missing) library.

Could you please try this ? thanks!
Comment 16 ypatil 2016-10-14 06:12:12 UTC
@Alex, thanks for support. By enabling managed linker(iOS Build -> Linker behaviour -> Link framework SDKs only) worked for me. thank you.
Comment 17 Sebastien Pouliot 2016-10-14 12:41:55 UTC
@Ypatil thanks for confirming.

Closing (upstream/Xcode behaviour on some computers).
Comment 18 Rolf Bjarne Kvinge 2016-10-14 15:01:00 UTC
So I ran into this too, and did some investigation.

The CoreAudioKit framework was only shipped for device in iOS 8, there was no corresponding framework for the simulator ([2] [3])

In iOS 9 Apple added the CoreAudioKit framework for the simulator.

This means that we started linking with CoreAudioKit when building for the simulator [1], unfortunately that means apps crash at launch when running on the iOS 8 simulator.

So I made a patch to only weak link with CoreAudioKit if the deployment target is simulator and < iOS 9: https://github.com/xamarin/xamarin-macios/pull/998

[1]: https://github.com/xamarin/xamarin-macios/commit/0d376c521a432e90cada391b731dae393778e7df
[2]: http://stackoverflow.com/a/25970676/183422
[3]: http://stackoverflow.com/q/31574430/183422
Comment 19 Sebastien Pouliot 2016-10-14 15:16:03 UTC
@Rolf, you had the same issue and this solves it ?

For some reasons the issue does not happen on every computer, neither Alex or I (on 2 diff Macs, El Capitan and Sierra) could duplicate it.

Also it's not clear that using a weak framework would solve the 

> 	/System/Library/Frameworks/CoreAudioKit.framework/CoreAudioKit: mach-o, but not built for iOS simulator
Comment 20 Rolf Bjarne Kvinge 2016-10-14 15:18:29 UTC
@Sebastien, yes, I had the same issue and this solves it.

I have no idea why you can't reproduce it (maybe you can try launching the app in the simulator, attach lldb and see if CoreAudioKit is loaded and where it's loaded from?)
Comment 22 Ivan Herrera 2017-01-06 18:23:52 UTC
Verified Fixed using XamarinStudio-6.2.0.1704 + xamarin.ios-10.4.0.67

Note You need to log in before you can comment on or make changes to this bug.