dart - 如何通过 Flutter 插件使用 cocoapods?

标签 dart flutter cocoapods

首先,我想说我不是 iOS 开发者

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

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

enter image description here

如何将 vlc 套件依赖 pod (pod "MobileVlcKit") 添加到此插件?

最佳答案

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

s.dependency 'MobileVLCKit'

或使用想要的版本

s.dependency 'MobileVLCKit', '3.2'

引用资料:

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

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

注意:你可能会遇到这个 issue - tl;dr(不是最佳选择)将 XCode 的构建系统更改为旧系统。

关于dart - 如何通过 Flutter 插件使用 cocoapods?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54349138/

相关文章:

flutter - 如何删除 AlertDialog 中的空格?

flutter - 使用 null 改写 Dart 2.0 中的 if 语句

flutter - 在小部件中定义成员时如何避免警告?

android - flutter 深度链接在真实设备上不起作用

ios - 将 CocoaPods 与 Swift 包混合使用

flutter - 如何根据不同的屏幕尺寸添加padding或margin

mobile - Flutter 中的上滑 View

kotlin - 如何降级 kotlin 版本

ios - Cocoapods中没有可见的@interface

svg - Cocoapods 规范访问和所有权问题