美文网首页
CocoaPods 问题和解决

CocoaPods 问题和解决

作者: JoinPerson | 来源:发表于2017-04-20 00:58 被阅读0次

    一、pod search 时出现[!] Unable to find a pod with name, author, summary, or description matching

    解决:rm ~/Library/Caches/CocoaPods/search_index.json 然后重新搜索

    二、[!] The repo `MySpecs` at `../../../.cocoapods/repos/MySpecs` is not clean 错误

    解决:cd ~/.cocoapods/repos/MySpecs,git clean -f

    三、error:include of non-modular header inside framework module

    在自定义类库中,引用了pop类库的POPAnimatableProperty.h头文件,配置好podspec文件后,执行pod lib lint时候,出现上述错误提示。因为使用了静态链接库方式集成。

    解决方法:添加--use-libraries,所以最后执行:pod lib lint --use-libraries

    四、error:大量警告warnings

    编译类库,难免存在警告,最好先解决警告,再编译检查。但是,如果需要忽略编译警告,则要添加额外设置。

    解决方法:添加--allow-warnings,所以最后执行:pod lib lint --allow-warnings

    五、error: unknown:Encountered an unknown error (Unable to find a specification for 'xxxx')

    在私有库中,引用了其他私有类库。因为校验podspec文件时候,默认会到CocoaPods的Specs仓库查找相关依赖类库,所以会出现找不到的错误提示。

    解决方法:添加需要查找的specs仓库的地址,所以最后执行:pod lib lint --sources='xxxx.git,yyyy.git'

    相关文章

      网友评论

          本文标题:CocoaPods 问题和解决

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