简体   繁体   中英

How to add ios source dependency to Flutter plugin?

I have created a Flutter plugin and this is my podspec file:

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

Then I need to add ios source, in Flutter project I would write source 'https://<path>/podspecs.git' in Podfile. How to add ios source to Flutter plugin?

Follow below steps

  1. Open iOS folder inside your plugin
  2. look for plugin_name.podspec
  3. After the line s.dependency 'Flutter' in podspec, add your ios dependencies like below.

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM