Description
New Issue Checklist
- I have looked at the DocumentationI have read the F.A.Q.
Issue Info
Info | Value |
---|---|
Platform | e.g. ios |
Platform Version | e.g. 8.0 |
SnapKit Version | e.g. 3.0.0 |
Integration Method | e.g. cocoapods |
Issue Description
Using Xcode 8 and Swift 3, my project fails to compile SnapKit and calls out 16 different issues (all but one are "Extraneous argument label 'some_label' in call").
For example, in Constraint.swift line 129 I see the following:
let layoutConstant: CGFloat = self.constant.constraintConstantTargetValueFor(layoutAttribute: layoutToAttribute)
Which shouldn't cause a compiler error because the most recent code in the 3.0 tag does explicitly call for an argument label in the constraintConstantTargetValueFor()
method.
However, the code pulled down from a pod install
differs from the code in the 3.0 tag as seen in GitHub. Here's the function signature I see in the Pod's ConstraintConstantTarget.swift file on line 45:
internal func constraintConstantTargetValueFor(_ layoutAttribute: NSLayoutAttribute) -> CGFloat
I'm not particularly familiar with CocoaPods, but it seems like the code isn't in sync.
Activity
robertjpayne commentedon Sep 15, 2016
@Chris-Corea what version of Cocoapods are you using? And are your command line tools definitely pointed @ Xcode 8?
adhiravishankar commentedon Sep 15, 2016
I'm on XCode 8 and there are issues with the latest version of SnapKit and Xcode 8. Most of it is extraneous arguments.
robertjpayne commentedon Sep 15, 2016
@adhiravishankar @Chris-Corea what may have happened is I did this release using Xcode 8 GM not Xcode 8 from app store and there may be some subtle difference.
I'm checking now.
robertjpayne commentedon Sep 15, 2016
@adhiravishankar @Chris-Corea so I've triple checked and I can't reproduce this.
Can both of you please confirm:
Xcode Version
8.0 (8A218a)
Cocoapods Version
pod --version
1.1.0.rc.2
Project Swift Version
Use Legacy Swift Language Version
NO
for your targetProject Podfile.lock
SnapKit (3.0.0)
under thePODS:
sectionHaijunWei commentedon Sep 15, 2016
Xcode Version 8.0(8A218a)
Cocoapods Version 1.0.1 (I tried to update, but no update)
Compile Error. It reminds me that I need to convert the swift version.
sahandnayebaziz commentedon Sep 15, 2016
@HaijunWei, since
1.1.0.rc.2
is an rc-version (release-candidate version), you can install it with this command:sudo gem install cocoapods --pre
sahandnayebaziz commentedon Sep 15, 2016
If anybody gets here who is having issues pushing a Swift 3 update to a pod that has SnapKit as a dependency, I was getting similar compile errors only when trying
pod spec lint
andpod trunk push
, while SnapKit was building fine with my framework in Xcode.I was able to fix this by running
echo "3.0" > .swift-version
in my directory as a hint to cocoapods. This is discussed further here: CocoaPods/CocoaPods#5864robertjpayne commentedon Sep 15, 2016
@sahandnayebaziz ah that is how you fix the linter! I cheated and just disabled the lint check in the gem ruby code.
Mosaics commentedon Sep 15, 2016
what time will be support swift3.0?
robertjpayne commentedon Sep 15, 2016
@Mosaics it's already supported, there's just some Cocoapods issues with installing dependencies. Nothing I can do for SnapKit to resolve that.
[-]Swift 3 CocoaPods Compile Errors[/-][+]Swift 3 - CocoaPods Integration Issues[/+]adhiravishankar commentedon Sep 15, 2016
I would hold off on renaming the issue just yet, I fixed my errors, but I might receive an update and it would get rid of it. I haven't had time yet to check it, but I'll highlight the issues I had as soon as I can.
adhiravishankar commentedon Sep 15, 2016
Also, all of those requirements did hold true.
robertjpayne commentedon Sep 15, 2016
@adhiravishankar I'm pretty positive it's an issue with Cocoapods, I've checked on two computers with Xcode 8 and also Travis isn't complaining.
I'm going to leave this issue up for a bit because there will be many upgraders over the next few weeks that run into the same problem.
RamboLouis commentedon Sep 15, 2016
In the test project using Xcode 8 (8A218a) and cocoapods (1.0.1), integrated SnapKit (3.0.0) 272 compile errors.
16 remaining items
xx11dragon commentedon Sep 20, 2016
@robertjpayne Yes swift3.0, solution: target-Build Phases- add Copy Files "SnapKit.framework".hhh
robertjpayne commentedon Sep 20, 2016
@xx11dragon weird, sounds like Cocoapods isn't integrating properly if the fix is to manually copy the framework. It should be doing that for you. 100% sure you are using v1.1.0.rc2? Ruby will allow multiple versions of the same gem to be installed.
xx11dragon commentedon Sep 20, 2016
@robertjpayne should be right...

robertjpayne commentedon Sep 20, 2016
@xx11dragon it should say 1.1.0.rc2 not beta.2
You need to update!
xx11dragon commentedon Sep 20, 2016
@robertjpayne so sorry...
lifez commentedon Sep 21, 2016
@robertjpayne delete all pod and pod install again it work
Thank you for attention
jcdickman commentedon Sep 29, 2016
$ pod --version 1.0.1
Finally got SnapKit installed and the app building @kevinlee85 's way.
The other approach (using the rc version) I kept running into issues on pod install:
Manually cloning the cocoapod repo or using pod repo add didn't work either. Uninstalling cocoapods, reinstalling 1.0.1 and pointing to SnapKit repo in Podfile did the trick for me.
danielCarlosCE commentedon Oct 14, 2016
My class didn't have
import SnapKit
but it was working just fine. Suddenly it stopped working.I tried everything above and didn't help. After adding the import, it worked =S
ssccsci commentedon Nov 14, 2016
@PlayLive it worked! thank u!:)
robertjpayne commentedon Apr 10, 2017
Closing this becauseI believe this is now fixed.
justrick31 commentedon May 31, 2017