[英]Install native iOS pod in flutter
我在使用 pod 时在 iOS 端制作 flutter 插件时遇到错误。 吊舱已成功安装,然后我也可以将它们导入文件中。
我尝试使用的 Pod 是Freshchat iOS SDK
我安装 pod 所遵循的步骤
启动一个新的 Flutter 插件项目。
在.podspec
文件中添加s.dependency 'FreshchatSDK'
在example/ios
文件夹中运行pod install
。
我有一个错误
The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/Users/nimish/FlutterProjects/freshchat_flutter/freshchat_flutter/example/ios/Pods/FreshchatSDK/FreshchatSDK/libFDFreshchatSDK.a)
我删除use_frameworks!
来自此评论后的podfile
。
我再次运行pod install
并成功安装了 pod,并创建了Pods
文件夹,其中FreshchatSDK
文件夹。
现在我需要use_frameworks!
在我的项目中,因为其他插件因此没有编译。
我在.podspec
和 use_frameworks 中添加了s.static_framework = true
use_frameworks!
在podfile
中。 现在pod install
运行成功,
在我的Plugin.h
文件中添加 import #import "FreshchatSDK.h"
后,出现错误
error: include of non-modular header inside framework module
我尝试了这个答案,但无法解决。
请帮我解决这个问题。 我会尊重你的时间。
这里还有另一个 flutter 插件,但它有很多问题,一个未处理的案例导致我的 iOS 应用程序崩溃,所以我想把它变成我自己的。
由于不匹配的目标,PodFile 中可能存在问题。 当我遇到这种情况时,我使用了这些简单的步骤。
Pod init
Pod install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.