繁体   English   中英

在 flutter 安装原生 iOS pod

[英]Install native iOS pod in flutter

我在使用 pod 时在 iOS 端制作 flutter 插件时遇到错误。 吊舱已成功安装,然后我也可以将它们导入文件中。

我尝试使用的 Pod 是Freshchat iOS SDK

我安装 pod 所遵循的步骤

  1. 启动一个新的 Flutter 插件项目。

  2. .podspec文件中添加s.dependency 'FreshchatSDK'

  3. 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)

  4. 我删除use_frameworks! 来自此评论后的podfile

  5. 我再次运行pod install并成功安装了 pod,并创建了Pods文件夹,其中FreshchatSDK文件夹。

现在我需要use_frameworks! 在我的项目中,因为其他插件因此没有编译。

  1. 我在.podspec和 use_frameworks 中添加了s.static_framework = true use_frameworks! podfile中。 现在pod install运行成功,

  2. 在我的Plugin.h文件中添加 import #import "FreshchatSDK.h"后,出现错误

    error: include of non-modular header inside framework module

我尝试了这个答案,但无法解决。

请帮我解决这个问题。 我会尊重你的时间。

这里还有另一个 flutter 插件,但它有很多问题,一个未处理的案例导致我的 iOS 应用程序崩溃,所以我想把它变成我自己的。

由于不匹配的目标,PodFile 中可能存在问题。 当我遇到这种情况时,我使用了这些简单的步骤。

  1. 删除 Podfile
  2. 在特定文件中打开终端
  3. Pod init
  4. 打开 Podfile 并添加依赖项
  5. Pod install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM