Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use cocoapods with a Flutter plugin?

First, I would like to say that I am not a iOS developer.

I am trying to develop a VLC plugin for Flutter. For so, I need to add its pod (pod "MobileVlcKit") to a podfile, right? But when I create the project (via the command flutter create -t plugin flutter_vlc_kit), the iOS folder inside the project has no podfile.

Also, it does not have any of the .xworkspace or .xcodeproj files that I can open on XCODE for code editing:

enter image description here

How can I add the vlc kit dependency pod (pod "MobileVlcKit") to this plugin?

like image 735
Daniel Oliveira Avatar asked Jan 24 '19 14:01

Daniel Oliveira


People also ask

Is CocoaPods necessary for flutter?

System requirements. Your development environment must meet the macOS system requirements for Flutter with Xcode installed. Flutter supports iOS 11 and later. Additionally, you will need CocoaPods version 1.10 or later.

How do I add flutters to Xcode?

Open the default Xcode workspace in your project by running open ios/Runner.xcworkspace in a terminal window from your Flutter project directory. Select the device you intend to deploy to in the device drop-down menu next to the run button. Select the Runner project in the left navigation panel.


1 Answers

Add your pod dependency modifying your ios/flutter_vlc_kit.podspec

s.dependency 'MobileVLCKit'

or with the wanted version

s.dependency 'MobileVLCKit', '3.2'

References:

  • Flutter Plugins

  • Cocoapods

Then go to your example/ios folder and run pod install.

Then open your Runner.xcworkspace and build your plugin from there.

Note: probably you could encounter this issue - tl;dr (not the best choice) change the build system of XCode to the legacy one.

like image 179
shadowsheep Avatar answered Sep 28 '22 06:09

shadowsheep