CocoaPods 安装第三方时出现的问题及解决

来源:互联网 发布:手游试玩赚钱软件 编辑:程序博客网 时间:2024/05/04 13:13

错误一

Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The swift Pod being used is: FBSnapshotTestCase

可能是要添加的这个库 不支持swift导致

解决方法

在podfile里面添加 use_frameworks!

# platform :ios, '10.0'target 'iOSShellNew' dopod 'Cordova'pod 'jsoncpp'pod 'Cache'use_frameworks!end

错误2

pod search AFNetworking 出现错误 [!] Unable to find a pod with name, author, summary, or description matchingAFNetworking“

解决方法

删除~/Library/Caches/CocoaPods目录下的search_index.json文件

  • pod setup成功后会生成~/Library/Caches/CocoaPods/search_index.json文件。
  • 终端输入rm ~/Library/Caches/CocoaPods/search_index.json
  • 删除成功后再执行pod search

  • 输出:Creating search index for spec repo ‘master’.. Done!,稍等片刻就会出现所有带AFNetworking字段的类库出现。

未完 待续。。。

阅读全文
0 0
原创粉丝点击