[!] No `Podfile' found in the project directory.

从网上下载的参考项目,运行时遇到的错误如下:

diff: /../Podfile.lock: No such file or directory diff: /Manifest.lock: No such file or directory error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation. 

错误显示

根据提示,在终端直接执行:pod install,出现错误如下:

错误显示

看到问题出现,感觉自己好傻,都没有创建Podfile,如果没有创建Podfile

文件将无法安装, CocoaPods都不知道改安装说明, 怎么去安装呢,

所以按照步奏来一步一步操作:

1.cd到自己的项目目录下(cd +空格+直接拖拽项目到终端)

2.vim Podfile(创建Podfile)

出现以下代码(配置文件,表示成功):

source'https://github.com/CocoaPods/Specs.git'

platform:ios,'8.0'

inhibit_all_warnings! 

target '工程名' do 

pod 'AFNetworking', '~> 2.6.0'

end

然后保存退出

esc

:wq

执行pod install

完美解决No `Podfile' found in the project directory.的问题。

猜你喜欢

转载自blog.csdn.net/dt1991524/article/details/81384013
今日推荐