17

I'm doing a flutter plugin for stream video by using RTSP protocol. I had no problem develop it for Android, but in iOS things are more complex. I have to use an external library (SGPlayer) for getting the player work. I also downloaded the demo that uses this library and seems to work. This library is NOT on Cocoapods and I need to import it directly into the plugin project from my file system. the downloaded and compiled file structure of the plugin that I would like to use looks like this:

External library file structure

My problem is adding the ".framework" extension file correctly to the iOS project in a way that I can use it to develop the flutter plugin (iOS part).

UPDATE: I built the project with the framework by using instructions at this link: https://github.com/flutter/flutter/issues/17978

The problem now is that while compiling the framework it change the umbrella header because, I think, it's not using the framework module.modulemap but another one. The result is that is importing just some header and implementations, and not all.

2
  • Hello, any solution to that ? Commented Oct 20, 2019 at 15:15
  • Sorry mate, I moved all parts to the main project and abandoned the idea to create a plugin. I had no time at work to find a solution on this things. Commented Oct 21, 2019 at 8:34

2 Answers 2

6

1.Place myFramework.framework to iOS plugin folder /ios ex: myPlugin/ios

2.Update iOS plugin file: myPlugin/ios/myPlugin.podspec Adding the below line at the bottom of the file, above 'end'

s.vendored_frameworks = 'myFramework.framework'

In Terminal : cd to myPlugin/example/ios run command

pod install

or

pod update

Now we can find the iOS plugin code by open iOS project (example/ios/Runner.xcworkspace) in XCode and go to

Sign up to request clarification or add additional context in comments.

Comments

1

@Lorenzo you can pack your plugin and make private CocoaPod or Carthage repo. Here is a good article howtos

2 Comments

First of all, thanks for the answer! I have a new question, at the moment, to get things works, I had to import the local framework by using the script that I found in the Github page that I had mentioned in my answer update. The problem is that I had to remove the use_frameworks! from the Podfile and now is impossible for me use Swift Pod if I would like to, but if I leave it, and I try to run the app I get a lot of errors. At this point, my question is: Is possible to use Objective-c pod in a Swift plugin? and how .podspec and Podfile settings are?
Hey, but what is IDEA behind creating private CocoaPod repo? I should create private CocoaPod and how then to connect my local .framework with that CocoaPod repo?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.