| Info | Value |
| --- | --- |
| Platform | e.g. ios |
| Platform Version | e.g. 8.0 |
| SnapKit Version | e.g. 3.0.0 |
| Integration Method | e.g. cocoapods |
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.
@Chris-Corea what version of Cocoapods are you using? And are your command line tools definitely pointed @ Xcode 8?
I'm on XCode 8 and there are issues with the latest version of SnapKit and Xcode 8. Most of it is extraneous arguments.
@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.
@adhiravishankar @Chris-Corea so I've triple checked and I can't reproduce this.
Can both of you please confirm:
8.0 (8A218a)
pod --version
1.1.0.rc.2
Use Legacy Swift Language Version
NO
for your targetSnapKit (3.0.0)
under the PODS:
sectionXcode 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.
@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
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
and pod 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: https://github.com/CocoaPods/CocoaPods/issues/5864
@sahandnayebaziz ah that is how you fix the linter! I cheated and just disabled the lint check in the gem ruby code.
what time will be support swift3.0?
@Mosaics it's already supported, there's just some Cocoapods issues with installing dependencies. Nothing I can do for SnapKit to resolve that.
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.
Also, all of those requirements did hold true.
@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.
In the test project using Xcode 8 (8A218a) and cocoapods (1.0.1), integrated SnapKit (3.0.0) 272 compile errors.
@RamboLouis try updating to cocoapods 1.1.0.rc.2 with:
sudo gem install cocoapods --pre
@robertjpayne Thanks for the quick reply. After installing updating cocoapods to 1.1.0.rc.2 and clearing my cache with pod cache --all clean
, I was able to pull down the latest (working!!) SnapKit code. I'll leave it up to you to whether you want to close this issue or leave it open.
Thanks for the help!
To reiterate:
pod cache --all clean
pod install
@sahandnayebaziz Thank you. I'm trying.
@RamboLouis awesome. Ping back if you have any trouble
@Chris-Corea I'm going to leave this issue open for a little bit until Cocoapods gets their release out as its going to trip up a lot of people.
I have fixed by directly point to the git link within Podfile to fix the 16 errors.
Like that: pod 'SnapKit', :git => 'https://github.com/SnapKit/SnapKit.git'
I will change back after Cocoapods can have the least codes on their repository.
I got this error
I have tried above methods, I wonder if your code has problem.
@Onetaway Can you please post up your Xcode version, Cocoapods version and project's Swift version?
I think a lot of people are having issues because they are trying to use the v3.0.0 with Swift 2.3.
@kevinlee85 curious why you had to pin it to master branch, what version of Cocoapods are you running?
Project cash and log:
dyld: Library not loaded: @rpath/SnapKit.framework/SnapKit
Referenced from: /Users/loong/Library/Developer/CoreSimulator/Devices/B94193C1-FA8B-444C-9473-B7627DB3C4E9/data/Containers/Bundle/Application/DCC2E74D-54ED-4B4B-BC04-616A46CF0FB7/SwiftDemo.app/SwiftDemo
Reason: image not found
XcodeVersion: 8.0 (8A218a)
CocoapodsVersion: 1.1.0.beta.2
SnapKitVersion: 3.0.0
Project: NewProject
"Use Legacy Swift Language Version" set "NO"
I got error like @Onetaway
https://puu.sh/rgl1k/43f4684095.png
https://puu.sh/rglgO/98245a5dca.png
Pod version: 1.1.0.rc.2
XcodeVersion: 8.0 (8A218a)
SnapKitVersion: 3.0.0
In SnapKit setting "Use Legacy Swift Language Version" set as "NO"
I use:
sudo gem install cocoapods --pre -n /usr/local/bin cocoa pods
then:
pod install
now it's ok!
@xx11dragon @lifez are both of you 100% sure your project is set to use Swift 3.0?
@robertjpayne right i just convert to swift 3.0
@lifez and it still persists? Can you share your project by chance or too confidential? I can't repro this issue unless I'm running old Cocoapods. Can you triple check pod --version
is showing 1.1.0.rc2?
@robertjpayne Yes swift3.0, solution: target-Build Phases- add Copy Files "SnapKit.framework".hhh
@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.
@robertjpayne should be right...
@xx11dragon it should say 1.1.0.rc2 not beta.2
robertjpaynelocal:SnapKit robertjpayne$ pod --version
1.1.0.rc.2
You need to update!
@robertjpayne so sorry...
@robertjpayne delete all pod and pod install again it work
Thank you for attention
I have fixed by directly point to the git link within Podfile to fix the 16 errors.
Like that: pod 'SnapKit', :git => 'https://github.com/SnapKit/SnapKit.git'
I will change back after Cocoapods can have the least codes on their repository.
$ 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:
Setting up CocoaPods master repo
Unknown option: -C
usage: git [--version] [--exec-path[=]] [--html-path] [--man-path] [--info-path]
[-p|--paginate|--no-pager] [--no-replace-objects] [--bare]
[--git-dir=] [--work-tree= ] [--namespace= ]
[-c name=value] [--help]
[ ]
[!] Unable to add a source with urlhttps://github.com/CocoaPods/Specs.git
namedmaster-1
.
You can try adding it manually in~/.cocoapods/repos
or viapod repo add
.
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.
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
@PlayLive it worked! thank u!:)
Closing this becauseI believe this is now fixed.
Hey robert fix it for ya? Well I wouldn't made that choice who the hell
are u
On Monday, April 10, 2017, Robert Payne notifications@github.com wrote:
Closing this becauseI believe this is now fixed.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/SnapKit/SnapKit/issues/300#issuecomment-292914089,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AJqjoNx_opue9XqlgT4cXjDK0vvwwgd9ks5ruge9gaJpZM4J9XAl
.
--
Sent from Gmail Mobile
Most helpful comment
@robertjpayne Thanks for the quick reply. After installing updating cocoapods to 1.1.0.rc.2 and clearing my cache with
pod cache --all clean
, I was able to pull down the latest (working!!) SnapKit code. I'll leave it up to you to whether you want to close this issue or leave it open.Thanks for the help!
To reiterate:
pod cache --all clean
pod install