How to add native iOS 3rd party framework into Flutter project

Viewed 90

I need to add a payment gateway framework to my ios module in flutter plugin project. I put the framework in plugin's ios directory. Here's my plugin's podspec file:

#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html.
# Run `pod lib lint ios_plugin_test.podspec` to validate before publishing.
#
Pod::Spec.new do |s|
  s.name             = 'ios_plugin_test'
  s.version          = '0.0.1'
  s.summary          = 'A new Flutter project.'
  s.description      = <<-DESC
A new Flutter project.
                       DESC
  s.homepage         = 'http://example.com'
  s.license          = { :file => '../LICENSE' }
  s.author           = { 'Your Company' => 'email@example.com' }
  s.source           = { :path => '.' }
  s.preserve_paths = 'SSLCommerzSDK.framework'
  s.xcconfig = {'OTHER_LDFLAGS' => '-framework SSLCommerzSDK'}
  s.vendored_frameworks = 'SSLCommerzSDK.framework'

  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

When I tried to run on imulator the following error shows while importing my framework class:

Could not find module 'SSLCommerzSDK' for target 'x86_64-apple-ios-simulator'; found: arm64, armv7-apple-ios, arm64-apple-ios, arm, armv7

Any suggestions?

0 Answers
Related