问题描述
我们的团队为 IOS 创建了一个 SDK,我已将其导入到我的 react 本机自定义库中。 SDK 还依赖于 Swift Package CocoaLumberjack。
我在我的 podspec 中添加了“s.dependency 'CocoaLumberjack','~> 3.7.0'”。 当我将我的库添加到 React Native 应用程序并运行 pod install 时,我收到如下错误:
The following Swift pods cannot yet be integrated as static libraries:
The Swift pod `react-native-sdk` depends upon `CocoaLumberjack`,which does not define modules. To opt into those targets generating module maps (which is necessary to import them from Swift when building as static libraries),you may set `use_modular_headers!` globally in your Podfile,or specify `:modular_headers => true` for particular dependencies.
我的应用程序 pod 文件如下:
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios,'11.0'
target 'SdkExample' do
config = use_native_modules!
use_react_native!(:path => config["reactNativePath"])
pod 'react-native-sdk',:path => '../..'
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled,Flipper will not work and
# you should disable these next few lines.
use_flipper!({ 'Flipper' => '0.80.0' })
post_install do |installer|
flipper_post_install(installer)
end
end
我的自定义库的 podspec 是这样的:
require "json"
package = JSON.parse(File.read(File.join(__dir__,"package.json")))
Pod::Spec.new do |s|
s.name = "react-native-sdk"
s.version = package["version"]
s.summary = package["description"]
s.homepage = package["homepage"]
s.license = package["license"]
s.authors = package["author"]
s.platforms = { :ios => "11.0" }
s.source = { :git => "https://github.com/ankushss/react-native-sdk.git",:tag => "#{s.version}" }
s.source_files = "ios/**/*.{h,m,mm,swift}"
s.dependency "React-Core"
s.dependency 'CocoaLumberjack','~> 3.7.0'
s.vendored_framework = 'ios/CustomFramework.framework'
end
请帮助我。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)