使用cocoapods時常見錯誤
這些錯誤基本cocoapods升級版本到1.0.0所造成的
錯誤1、
當寫在Podfile文件中的第三方框架,不能使用,找不到時
查看Pods文件夾,是否下載了所需要的第三方框架,沒有的話就 pod update
錯誤2、
Could not automatically select an Xcode project. Specify one in your Podfile like so:xcodeproj?'path/to/Project.xcodeproj'
在Podfile文件里指定下工程目錄就行了
xcodeproj?'Demo/Demo.xcodeproj'
但是如果cocoapods版本為(1.0.0)的話,可能會有以下警告
[!] xcodeproj was renamed to `project`. Please use that from now on.
這時只需要把xcodeproj改為 project就行了
project 'Demo/Demo.project'
錯誤3、
The dependency `AFNetworking (~> 3.0)` is not used in any concrete target.
在Podfile中添加
target 'MyApp' do
(myAPP)換成你自己的工程名就好了
錯誤4、
[!] Invalid `Podfile` file: syntax error, unexpected end-of-input, expecting keyword_end.
在Podfile的末尾添加 end
錯誤5、
Unable to find the Xcode project `/Volumes/BIAO/iOS/code/MBWB.xcodeproj` for the target `Pods`.
在Podfile中 將 ?project 'Demo/Demo.project’? 改成 ?project 'Demo.project'
錯誤6、
build diff: /../Podfile.lock: No such file or directory
在工程設置中的Build Phases下刪除Check Pods Manifest.lock及Copy Pods Resources
如果提示Permission denied @ rb_sysopen - /Users/John_LS/.gemrc這個錯誤,那說明沒有權限。
原因:我已經更新了我的rubygem像這樣的gem update --syste,但是,只有我當地的gems被更新。由于gem: --user-install安裝限制在我的/etc/.gemrc。當工作時,它使用全局rubygem與我無關。
解決方法:要解決這個問題,我更新了全局的RubyGems:sudo gem update --system --no-user-install.。
cocopods 搜索
pod search json