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:
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:
I faced some small annoying problems
- Project and all it’s frameworks must have same Swift version
- Most of Swift framework don’t have Swift 3.0 branch and should be build for Swift 2.3
- Every pod update and pod install resets “Use Legacy Swift Language Version” to No (which means this framework will compile using Swift 3.0)
- To build for a real device I should sign every target
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:
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: