Ios 创建一个cocoapod,该cocoapod将编译的框架作为依赖项
我正在创建一个Cocoapod(Ios 创建一个cocoapod,该cocoapod将编译的框架作为依赖项,ios,xcode,cocoapods,Ios,Xcode,Cocoapods,我正在创建一个Cocoapod(MyPod),它支持具有框架依赖性的iOS和TVO。我没有访问框架代码的权限,但是有编译过的框架,让我们称之为ThirdParty.framework。iOS和TVO有不同版本的框架 我能够直接在Xcode中成功构建buildMyPodtarget,并在其他项目中使用生成的框架。但要创建pod,当我运行pod lib lint时,它会显示一个错误: 错误:无法从模块接口生成模块“第三方”;生成它的编译器“Apple Swift version 5.1.2(swif
MyPod
),它支持具有框架依赖性的iOS和TVO。我没有访问框架代码的权限,但是有编译过的框架,让我们称之为ThirdParty.framework
。iOS和TVO有不同版本的框架
我能够直接在Xcode中成功构建buildMyPod
target,并在其他项目中使用生成的框架。但要创建pod,当我运行pod lib lint
时,它会显示一个错误:
错误:无法从模块接口生成模块“第三方”;生成它的编译器“Apple Swift version 5.1.2(swiftlang-1100.0.278 clang-1100.0.33.9)”可能使用了此编译器不支持的功能,“Apple Swift version 5.3(swiftlang-1200.0.29.2 clang-1200.0.30.1)”
这是我的播客规范:
s.name = 'MyPod'
Pod::Spec.new do |s|
s.name = 'MyPod'
s.version = '0.1.0'
s.summary = 'This is MyPod'
s.description = <<-DESC
Provides functionality for ....
DESC
s.static_framework = true
s.homepage = 'https://github.com/username/MyPod'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'username' => 'myemail@email.com' }
s.source = { :git => 'https://github.com/username/MyPod.git', :tag => s.version.to_s }
s.ios.deployment_target = '13.0'
s.swift_versions = '5.0'
s.ios.source_files = 'MyPod/Common/**/*.swift', 'MyPod/Platform/iOS/**/*.swift'
s.tvos.source_files = 'MyPod/Common/**/*.swift', 'MyPod/Platform/tvOS/**/*.swift'
s.ios.vendored_frameworks = 'MyPod/Frameworks/ios/universal/ThirdParty.framework'
s.tvos.vendored_frameworks = 'MyPod/Frameworks/tvos/universal/ThirdParty.framework'
s.preserve_path = 'MyPod/Frameworks'
end
s.name='MyPod'
Pod::规格新do | s|
s、 name='MyPod'
s、 版本='0.1.0'
s、 summary='这是MyPod'
s、 description='LICENSE'}
s、 作者={'username'=>'myemail@email.com' }
s、 source={:git=>'https://github.com/username/MyPod.git',:tag=>s.version.to_s}
s、 ios.deployment_target='13.0'
s、 swift_版本='5.0'
s、 ios.source_文件='MyPod/Common/***.swift','MyPod/Platform/ios/***.swift'
s、 tvos.source_文件='MyPod/Common/***.swift','MyPod/Platform/tvos/***.swift'
s、 ios.vendored_frameworks='MyPod/frameworks/ios/universal/ThirdParty.framework'
s、 tvos.vendored_frameworks='MyPod/frameworks/tvos/universal/ThirdParty.framework'
s、 保存路径='MyPod/Frameworks'
结束
我不完全理解这个错误,但当我运行
pod lib lint
cocoapods试图重建框架时,它似乎正在尝试。所以问题是,有没有一种方法可以在不构建ThirdParty.framework的情况下链接ThirdParty.framework以避免此错误?您需要使用Swift版本构建ThirdParty.framework。因为您的版本是5.3,所以5.1.2中的第三方版本应该使用5.3进行编译。你能重建它吗?不,我们不能重建。该框架来自外部客户端,我们没有源代码。我会使用Xcode 11.2.1(如果需要,请重新安装),至少它的编译器/命令行工具(Xcode/Settings/Locations)会选择它。