cocoapods使用中部分错误

今天在使用cocoapods管理自己的swift项目时,出现了一些错误,项目编译时出现

The sandbox is not in sync with the Podfile.lock. Run 'pod install' or updat

在终端执行pod install 命令前,提示我先gem install cocoapods
,可是执行$sudo gem install cocoapods时提示了一下错误:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory

经过网上的一番搜藏,终于找到了一篇博客,
http://blog.csdn.net/lllkey/article/details/50802275
,将指令更改为了$sudo gem install -n /usr/local/bin cocoapods,当我兴致冲冲的去执行$pod install时,又出现的:

[!] The dependency `Alamofire` is not used in any concrete target.

我有辗转多地,找到了
http://www.th7.cn/Program/Ruby/201601/759136.shtml
如果出现[!] The dependency Alamofire (~> 1.2.2) is not used in any concrete target的错误提示,就将Podfile改为:

source 'https://github.com/CocoaPods/Specs.git' 
platform :ios, '7.0' 
use_frameworks! 
target "TargetName" do 
pod 'Alamofire', 
end

TargetName指的是你的工程名。

终于可以愉快的使用第三方框架了。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容