首页 > 解决方案 > 如何将 ios 源依赖添加到 Flutter 插件?

问题描述

我创建了一个 Flutter 插件,这是我的 podspec 文件:

Pod::Spec.new do |s|
  s.name             = 'sdksso'
  s.version          = '0.0.1'
  s.summary          = 'A new flutter plugin project.'
  s.description      = <<-DESC
A new flutter plugin project.
                       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.dependency 'Flutter'
  s.platform = :ios, '8.0'

  # Flutter.framework does not contain a i386 slice.
  s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' }
  s.swift_version = '5.0'
end

然后我需要添加 ios 源,在 Flutter 项目中我会source 'https://<path>/podspecs.git'在 Podfile 中编写。如何将 ios 源添加到 Flutter 插件?

标签: iosflutterpodspecflutter-pluginpodfile

解决方案


推荐阅读