iOS 组件化私有库常见问题

本文总结了iOS组件化私有库在开发过程中遇到的20个常见问题,包括验证错误、集成报错、索引库问题、依赖第三方库报错等,并提供了详细的解决方法,如修改podspec文件、更新本地索引库、设置VALID_ARCHS等。
摘要由CSDN通过智能技术生成
问题一
XXX did not pass valibation,due to 1 error

这种情况是组件验证常见错误,一般有 - ERROR 提示;根据错误提示修改即可;但有时会遇到没有任何- ERROR的情况,这时首先在验证选项中添加 --verbose 在次验证; 可以搜索 fail 和 error看看有没有信息;已然没有时建议使用远程验证的方式在此验证;这时可能就能拿到错误信息了,修改直至验证通过就可以提交podspec文件
注意:远程验证必需先提交代码到远程仓库的

问题二
[!] The XXPhotoKit.podspec specification does not validate.

1.本地版本和远程不同步造成
2.或者是项目支持最低版本不一致造成
3.是本地索引库的问题,可以重新建一个索引库提交试试;前提是spec文件验证没有问题

问题三 主工程集成报错
[!] Unable to find a specification for `ZLPhotoBrowser` depended upon by `XXPhotoKit`

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

主工程集成时需要添加一下source到podfile文件:
source ‘https://github.com/CocoaPods/Specs.git’

问题四 索引库报错
[!] Unable to add a source with url https://github.com/CocoaPods/Specs.git named cocoapods.
You can try adding it manually in /Users/mac/.cocoapods/repos or via pod repo add.

[!无法添加url ’ https://github.com/CocoaPods/Specs.git ’ named ’ cocoapods ‘的源文件。
你可以尝试在’ /Users/mac/中手动添加。cocoapods/repos ‘或通过’ pod repo add '。

问题五
Unable to find a specification for XXXXX

[!] Unable to find a specification for `PTBLogInModel`

You have either:
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

解决方法:
更新本地索引库:pod repo update
pod install 报错 An unexpected version directory

问题六

[!] An unexpected version directory `Classes.png
这个错误,请查看:

podspec 是否未上传到服务器
Podfile的source地址是否是Spec Repo的地址,而不是具体某一个Pod的地址。

请注意:只需要配置索引库的源即可

platform :ios, '9.0'

source 'https://gitee.com/xxx/PTBSpecs.git'

target 'MainUIKit' do

pod 'XXXUIKit'

end
问题七 没有分支权限
[!] /usr/bin/git -C /Users/mac/.cocoapods/repos/PTBPods push origin HEAD

remote: GitLab: You are not allowed to push code to protected branches on this project.        
To code.aliyun.com:pintuibao-ios/PTBPods.git
 ! [remote rejected] HEAD -> master (pre
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值