我正在创建Flutter插件。但是,当我尝试向插件的iOS部分添加依赖项时,我没有为此找到任何适当的指南。我在插件的podspec
文件中声明了依赖项。但是该依赖项仅在example/ios
中通过Pod可用,但是我想在我插件的ios
文件夹中访问该依赖项。这是我的podspec
:
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'comet_chat'
s.version = '0.0.1'
s.summary = 'A new Flutter plugin.'
s.description = <<-DESC
A new Flutter plugin.
DESC
s.homepage = 'http://example.com'
s.license = { :file => '../LICENSE' }
s.author = { 'Your Company' => 'email@example.com' }
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'CometChatPro', '1.4.0'
s.ios.deployment_target = '10.0'
s.preserve_paths = 'CometChatPro.framework'
s.xcconfig = { 'OTHER_LDFLAGS' => '-framework CometChatPro' }
s.vendored_frameworks = 'CometChatPro.framework'
end
我关注了this问题,但这没有帮助。如何解决这个问题?如何仅获得插件的依赖关系?