美文网首页
cocoapods使用中部分错误

cocoapods使用中部分错误

作者: 疾风小超 | 来源:发表于2016-05-19 10:42 被阅读125次

今天在使用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指的是你的工程名。

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

相关文章

网友评论

      本文标题:cocoapods使用中部分错误

      本文链接:https://www.haomeiwen.com/subject/vffgrttx.html