Everything is fine on iOS 10, but app crashes at startup on iOS 8.1 .
I saw the following in the release notes:
Issue: Applications re-compiled against the new iOS 10 SDK crash at startup. iOS 10 requires additional keys (in their Info.plist) to access some private resources (e.g. calendar, photos, music...). iOS will crash (by design) applications using the related API if those keys are missing. (The string "CRASHING_DUE_TO_PRIVACY_VIOLATION" can appear in the stack trace for the crash in these cases.)
Workaround: Update your Info.plist with the required privacy keys. The required key (causing the crash) can be seen in the device logs.
My app doesn't require access to any private resources as far as I'm aware, I couldn't find any device log either.
This is the console output when debugging the app on iOS 8.1:
Launching 'Colosseo' on 'iPhone 6 iOS 8.1'... Launch succeeded. The app 'Colosseo' has been successfully launched on 'iPhone 6 iOS 8.1'. The app has been terminated.
It wouldn't debug any further.
Update:
I just deployed the app to an iOS8.1 iPad mini device and it launched fine. It seems that this is only a problem with the simulator.
The particular symptom involving CoreAudioKit (from the crash log) appears to match Bug 44996. The fix for that issue is scheduled for release as part of the Cycle 9 branch. Work is in progress right now to get builds of Cycle 9 prepared for the Alpha updater channel (hopefully within the next few business days). If you wished, you could also experiment with the continuous open source builds of Xamarin.iOS from the "master" branch: https://jenkins.mono-project.com/view/Xamarin.MaciOS/job/xamarin-macios-builds-master/.
Answers
It's happening the same with me! Glad it works with a iOS 8 device, unfortunately I don't have any to test
Hey guys,
I also have this problem, has anyone found out the reasoning behind it? I'm not sure if its a code specific problem or just a problem with the simulators due to not having any testing devices currently.
If you don't use a privacy-related topic and it only crashes on the simulator, the other thing that jumps out is whether you're attempting to access a hardware feature that is not emulated by the simulator. Are you doing anything with Core Motion or wide-color?
To help others with "crash on startup":
The privacy issue and
NS{Topic}UsageDescription
requirement is definitely one that bites you when you switch to iOS 10 and it fits your description of the "crash on launch" (well, crash on the first access of the private topic, which is often done during startup).Here are the topics:
Hi @LarryOBrien , thanks for your guidance.
We've been able to get the app to run on iOS 8.1 by enabling linking. Both 'Link all assemblies' and 'Link SDK assemblies only' fix the crash. Do you have any idea as to why this fixes it?
We aren't using core motion or wide-color. We do access the contacts but we have the required 'NSContactsUsageDescription' key in our Info.plist and the app works fine (without linking) on iOS 9+.
Same problem here. The workaround suggested by @Arramus works for me as well.
Summary:
I personally don't know if this is a Xamarin or an Xcode installation issue.
System Logs for app crash on iOS 8.1 ===========================
@LarryOBrien See my comment above. It should help the team investigate further.
My App just work fine except on ios10, I using location update so I have to enable Background modes -> Location Update in my info.plist and everything works.
Hope this help
I am starting to have this issue with other simulators too (like iOS 10). The workaround of Linking SDK assemblies still works, but it really slows down compilation time.
@MichelangeloFranco Thanks for your tip, but I think that the root cause for this issue is compilation-related. The compiler is obviously trying to load unnecessary assemblies that are missing whenever the Xamarin SDK is not explicitly linked.
We're running into the iOS 8 simulator issue as well. Linking SDK assemblies for the simulator also fixes it for us. Has anyone opened a bugzilla on this issue that we can all track?
Edit: Adding the original error message I saw in my simulator log here, for SEO purposes in case people are googling what I was googling before I found this thread. The error message was
Service exited due to signal: Trace/BPT trap: 5 Application 'UIKitApplication:com.our.domain[0xa7db]' crashed.
The particular symptom involving CoreAudioKit (from the crash log) appears to match Bug 44996. The fix for that issue is scheduled for release as part of the Cycle 9 branch. Work is in progress right now to get builds of Cycle 9 prepared for the Alpha updater channel (hopefully within the next few business days). If you wished, you could also experiment with the continuous open source builds of Xamarin.iOS from the "master" branch: https://jenkins.mono-project.com/view/Xamarin.MaciOS/job/xamarin-macios-builds-master/.