如何在Flutter插件中使用cocoapods?

Dan*_*ira 8 dart cocoapods flutter

首先,我想说我不是iOS开发人员

我正在尝试为Flutter开发VLC插件。为此,我需要将其pod(pod“ MobileVlcKit” pod)添加到podfile中,对吗?但是当我创建项目(通过命令flutter create -t plugin flutter_vlc_kit)时,项目内的iOS文件夹没有podfile。

此外,它没有任何。xworkspace要么 。xcodeproj我可以在XCODE上打开以进行代码编辑的文件:

在此处输入图片说明

如何将vlc kit依赖项pod(pod“ MobileVlcKit”)添加到此插件?

sha*_*eep 9

添加您的pod依赖项,修改您的 ios/flutter_vlc_kit.podspec

s.dependency 'MobileVLCKit'
Run Code Online (Sandbox Code Playgroud)

或通缉的版本

s.dependency 'MobileVLCKit', '3.2'
Run Code Online (Sandbox Code Playgroud)

参考文献:

然后转到您的example/ios文件夹并运行pod install

然后打开您Runner.xcworkspace的插件并从那里构建您的插件。

注意:可能您会遇到此问题 -tl; dr(不是最佳选择)将XCode的生成系统更改为旧版本。