谷歌Cocoapods没有安装

时间:2015-07-14 22:34:02

标签: ios objective-c cocoapods google-analytics-sdk

每当我尝试安装任何Google的cocoapods时,我都会遇到两个错误之一。

或者:

$ pod install
Analyzing dependencies
[!] The version of CocoaPods used to generate the lockfile (0.38.0.beta.2) is higher than the version of the current executable (0.37.2). Incompatibility issues may arise.

CocoaPods 0.38.0.beta.2 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Downloading dependencies
Installing Google (1.0.7)

[!] Error installing Google

...

inflating: /var/folders/<myDirectory>/Samples/signin/SignInExampleSwift/ViewController.swift  
warning [/var/folders/<myDirectory>/file.zip]:  375 extra bytes at beginning or within zipfile

(attempting to process anyway)

或者:

$ pod install
[in /Users/<user>/Desktop/FakeProject]
Analyzing dependencies

CocoaPods 0.38.0.beta.2 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.

For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.

Downloading dependencies
Installing AppInvites (1.0.1)

[!] Error installing AppInvites
[!] /usr/bin/tar xfz /var/folders/<myDirectory>/file.tgz -C /var/folders/<myDirectory>

tar: Unrecognized archive format

tar: Error exit delayed from previous errors.

我一直在尝试使用新的和现有的objective-c项目,并尝试卸载和重新安装cocoapods。不确定问题似乎是什么,谷歌没有对他们的cocoapods进行任何故障排除。

4 个答案:

答案 0 :(得分:21)

尝试更新宝石

sudo gem update -n /usr/local/bin cocoapods
pod install

答案 1 :(得分:0)

我遇到了同样的问题,我先gem install cocoapods pod install,然后public static Date dateFromUTC(Date date){ return new Date(date.getTime() + Calendar.getInstance().getTimeZone().getOffset(date.getTime())); } 工作正常。

答案 2 :(得分:0)

删除podfile.lock并pod install为我修复了它。

答案 3 :(得分:0)

6小时后我发现了这个

转到http://cocoapods.org/并下载tar文件