很多人从git上download工程,在运行时后报no input files错。
1.首先检查自己的pch路径是否正确;
2.检查是否自己删除或者因为删除或者移动了某一个文件,但是在你的编译资源里面( project > target > Build Phases > Compile Sources)还存在它,只要在(project > target > Build Phases > Compile Sources)里面把那些红色的文件删除掉,就可以编译过了。
3.也是今天讲的主点,很多情况下这种报错原因时三方库找不到,更多情况下是此项目的三方库是用cocopods进行管理的,那么在使用的时候需要进行本地更新。
<1>首先你在终端检查你电脑上是否装有cocopods(cocopods版本不同也会导致报错)
安装cocopods教程 http://www.code4app.com/article/cocoapods-install-usage
<2>安装好cocopods后,(此时的cocopods最新版本,cocopods向下兼容),在终端cd文件夹所在的目录(注意:一定要cd到podfile文件的目录下,终端路径可以直接把文件拖过来,不需要手动写路径)之后输入命令pod install,如果不行,可以使用命令pod install --verbose --no-repo-update来进行更新lib,输入完之后,一定要稍等几分钟,等待终端提示同步完成后再退出终端,之后打开后缀为.xcworkspace的文件,即可运行。
pod报错
git下载工程cocopods第三方库报错解决办法 - 简书
pod删除
1.CDN: trunk URL couldn't be downloaded
因为 CocoaPods 在 1.7 版本中开始引入 CDN 方式
pod repo remove trunk
pod search ***
失败的话,则需要在 podfile 顶部添加
source 'https://github.com/CocoaPods/Specs.git'
2.卡在Setting up CocoaPods master repo上
删除项目中与cocoapods有关的东西,包括Podfile
执行命令 pod init
如果出现
[!] Existing Podfile found in directory
执行命令
cd ~/.cocoapods/repos
git clone https://github.com/CocoaPods/Specs.git master
再执行命令
pod init
pod install
然后将需要添加的类库加到Podfile中
pod update
3.syntax error, unexpected ',', expecting keyword_end.
添加多个库,不指定库的版本时,不能加逗号
4.卡在Cloning spec repo `cocoapods` from `git@github.com:CocoaPods/Specs.git`
解决:
pod setup
cd ~/.cocoapods/repos
git clone --depth 1 https://github.com/CocoaPods/Specs.git master
如果报错
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
解决:
git config --global http.postBuffer 524288000