Update to iOS 9. Splunk, Cocoa Pods, SSL Domains & co.

I am working with an app which is updated infrequently every few months. This time it was necessary to build with the SDK iOS 9.0. But when I want to build the app using XCode I got this error:

"This app is not allowed to query for scheme cydia"

BUT WHO THE HELL is Cydia? :) Because I never used Jailbroken devices I didn't know that Cydia is the App Store alternative for jailbroken devices. My App uses Splunk MINT for monitoring and they call the scheme "cydia://" to check if a device is jailbroken, because most jailbroken devices have Cydia installed. Anyway. This was the message everything started with and finally led to a chain of updating different parts.

Updating Cocoapods

This was the next error message

[MT] DVTAssertions: ASSERTION FAILURE in /Library/Caches/com.apple.xbs/Sources/IDEFrameworks/IDEFrameworks-8227/IDEFoundation/Initialization/IDEInitialization.m:590

An update to Cocoapods 0.38.2 finally solves this

[bash] gem install cocoapods [/bash]

Broken post_install

After updating to the newer cocoapods version I got this error

undefined method `project' for #Pod::Installer:0x007fcfbb492798

But I read here that there is an easy fix.

Yes, the post install script needs to be updated for 0.38, see the release notes athttps://github.com/CocoaPods/CocoaPods/releases/tag/0.38.0.beta.2 for more information. The gist is,project needs to be changed to pods_project.

OK, so changing my post install hook to [ruby] installer_representation.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ONLY_ACTIVE_ARCH'] = 'NO' end end [/ruby] works fine and I could finish the [bash] pod install [/bash]

Library not Found

After that Xcode notified me that libraries could not be found.

ld: library not found for -lPods-<PROJECT_NAME>-AFNetworking ld: library not found for -lPods-<PROJECT_NAME>-MGBenchmark ...

In this case the solution was to remove the "Pods-<PROJECT_NAME>" prefix from the linking. This has been changed in cocoapods in the newer version.

SSL domains without TLS 1.2

My app uses a lot HTTP requests using AFNetworking to remote API hosts. But they didn't work anymore and I got this message:

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)

Hello NSAppTransportSecurity! We need to modify the plist file. A quick 'hack' to fix this, is to allow request to hosts which do not support TLS 1.2. Add this to the Info.plist [xml]NSAppTransportSecurityNSAllowsArbitraryLoads[/xml] Not an ideal solution. Better is to update the host - if you can. More about Apple's App Transport Security (ATS) can be found in the App Transport Security Technote.