小编Jim*_*one的帖子

pod中的供应框架无法被项目或其他pod识别(Cocoapods/Cocoapods#3810)

在我的项目中,我引用了我公司使用的几个私有pod.其中一个称为DKKit的pod依赖于另一个我称为BaseProKit的私有pod.BaseProKit包含3个框架,它在其头部和实现文件中引用,我认为这些框架被认为是vendored_frameworks.在BaseProKit的现有头文件中,通过导入引用了这些框架,这些框架#import <PPCommon/PPCommon>在编译时工作得很好(通常),而仅依赖于BaseProKit pod.但是,当包含DKKit时,DKKit会在导入BaseProKit.h包含上述导入的导入时查找标题别名.然而,在DKKit的上下文中,似乎DKKit pod不知道PPCommon框架的存在,并且它只看到它的头文件的别名通过Pods-BaseProKit引用.因此,任何和所有引用<PPCommon/ANYTHING>创建编译错误(未找到),以及我迄今为止唯一能够弄清楚的方法是只#import "PPCommon.h"需要通过引用来调整整个BaseProKit中的所有导入项目,这感觉不对.

我已经包含以下文件供参考:BaseProKit的Podspec:

  s.name         = "BaseProKit"
  s.version      = "1.0.5"
  s.source_files = "BaseProKit/BaseProKit.h",
                   "BaseProKit/Data/*.{h,m}",
                   "BaseProKit/Sensor Calibration/*.{h,m}",
                   "BaseProKit/SP3D/BaseballSceneController/*.{h,m}",
                   "BaseProKit/SP3D/SceneElements/*.{h,m,hpp,cpp}",
                   "BaseProKit/SP3D/SceneEnvironment/*.{h,m}",
                   "BaseProKit/Third Party/DeviceModelDetector.{h,m}",
                   "BaseProKit/Third Party/SkyProKitEmptyMMFile.{h,mm}"
  s.resources = "BaseProKit/SatelliteLibrary/SatelliteLibrary.bundle","BaseProKit/SP3D/SP3DResources.bundle", "BaseProKit/SP3D/Models/Vertex Data/*"
  s.frameworks = "GLKit", "OpenGLES", "Foundation", "UIKit", "Accelerate", "PPCommon", "SatelliteLibrary", "SP3D"
  s.library = 'c++'
  s.prefix_header_file = "BaseProKit/BaseProKit-Prefix.pch"
  # s.public_header_files = "BaseProKit/PPCommon/PPCommon.framework/Headers/*.h", "BaseProKit/SatelliteLibrary/SatelliteLibrary.framework/Headers/*.h", "BaseProKit/SP3D/SP3D.framework/Headers/*.h"

  s.vendored_frameworks = "BaseProKit/PPCommon/PPCommon.framework",
                          "BaseProKit/SatelliteLibrary/SatelliteLibrary.framework",
                          "BaseProKit/SP3D/SP3D.framework"
Run Code Online (Sandbox Code Playgroud)

DKKit的Podspec:

    s.name          = "DKKit"
    s.version       = "1.0.0"

    s.source_files  = 'DKKit/**/*.{h,m}'
    s.resources = 'DKKit/**/*.xcdatamodeld' …
Run Code Online (Sandbox Code Playgroud)

frameworks objective-c objective-c++ cocoapods

5
推荐指数
1
解决办法
822
查看次数