创建一个具有已编译框架作为依赖项的cocoapod

问题描述

我正在创建一个Cocoapod(MyPod),它支持具有框架依赖性的iOS和tvOS。我没有访问框架代码的权限,但是拥有已编译的框架,因此将其称为ThirdParty.framework。 iOS和tvOS的框架版本不同。

我能够直接在Xcode中成功构建构建MyPod目标,并在其他项目中使用生成的框架。但是,要创建pod,在我运行pod lib lint时会显示错误

error: Failed to build module 'ThirdParty' from its module interface; the compiler that produced it,'Apple Swift version 5.1.2 (swiftlang-1100.0.278 clang-1100.0.33.9)',may have used features that aren't supported by this compiler,'Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)'

这是我的podspec:

 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

我不完全理解该错误,但似乎当我运行pod lib lint时,cocoapods试图重建框架。因此,问题是,有没有一种方法可以链接ThirdParty.framework,而无需构建它来解决错误

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...