• Home
  • About
    • 程双双 photo

      程双双

      我慢慢地听雪落下的声音~

    • Learn More
    • Email
    • Github
    • Weibo
  • Posts
    • All Posts
    • All Tags
  • Projects

Podspec文件采坑记录

26 Feb 2019

[!] CocoaPods could not find compatible versions for pod "library/WechatOpenSDK":
  In Podfile:
    library/WechatOpenSDK (from `XXXX.git`, branch `dev1.1.0`)

None of your spec sources contain a spec satisfying the dependency: `library/WechatOpenSDK (from `XXXX.git`, branch `dev1.1.0`)`.

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

Note: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default.

总结:

出现这种情况,一般原因就是库中的podspec文件加载的时候出问题了,检查一下是否新增了podspec文件.

:git=> 的方式优点就是便于管理,缺点是有改动的话必须提交才能拉取,可以直接通过:subspec=>方式指定组装的类库,但是要注意项目中其他的引入方式没有重复导入,导致 :subspec=> 失效不起作用 toolbox的podspec文件中包含 s.dependency ‘library’ 通过 :path=> 方式引入,但是这时使用 :git=> :subspec=> 方式引入module_library_ios中的某些类库就不起作用,导致把全部的库都会导入,所以要注意dependency的写法,最好要指定明确.

约定 library 暂时统一用 :git=> 的方式指定 :subspec=>

其他的库可以使用 :path=> 的方式,但是要注意依赖的正确写法,指明清楚 s.dependency ‘’



模块化Podfilepodspec