Xcode 8 beta 1 + CocoaPods = 💔

UPDATE 2 (02.10.16):

If you are using Xcode 8, you must install -pre version of CocoaPods:

sudo gem install cocoapods --pre

If you are facing such error:

Image for post
Image for post
Possible error

You can try this solution: http://stackoverflow.com/questions/25889189/unable-to-run-app-in-simulator-an-error-was-encountered-while-running-domain/39049990#39049990


Philipp Engel mention that the signing issue is solved by cocoapods version 1.1.0.beta.1. Using this version, only the SWIFT_VERSION setting has to be applied.

So your Podfile for Swift 2.3 will be somethin like this:

iOS 10 have tones of tasty API, yes? Maybe you want to create a new project with Speech Recognition API or build an app for watchOS 3?

I faced some small annoying problems

  1. Project and all it’s frameworks must have same Swift version
  2. Most of Swift framework don’t have Swift 3.0 branch and should be build for Swift 2.3
  3. Every pod update and pod install resetsUse Legacy Swift Language Version” to No (which means this framework will compile using Swift 3.0)
  4. To build for a real device I should sign every target
Image for post
Image for post
Use Legacy Swift Language Version (No for Swift 3.0, Yes for Swift 2.3)
Image for post
Image for post
Signing problem

How to solve them?

First problem might be solved by using Swift 2.3 in real project. Go to your target, select build settings tab, search for “Legacy” and set Yes for “Use Legacy Swift Language Version”.

Second might be solved by using same for all your Swift frameworks, but we will improve Podfile, to make it automatic.

Here we go through all our frameworks (targets) and set Swift Version in the build settings (Use Legacy Swift Language Version” to Yes)

Okey, but there is one more problem — Signing.

First of all, lets find developer info:

Image for post
Image for post
Check that your project is signed
Image for post
Image for post
Show Package Contents of this project and then open `project.pbxproj` file
Image for post
Image for post
Then seach for the name and remember `DevelopmentTeamName` and `DevelopmentTeam`

Then add new lines to your podfile

You have to replace developer_info with information finded on step above

This code will go through all your targets, saving them reference id and added sign info to target attributes.

Important: I didn’t find how to execute this code after creating `Pods.xcodeproj` if it wasn’t there first, so I added log. If it’s your first pod install then you have to do it one more time. Maybe someone knows more elegant solution, I will be pleased.

Here is my final podfile:

Written by

iOS developer and Product Manager

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store