ios - 在 Flutter 中安装原生 iOS pod
问题描述
我在使用 pod 时在 iOS 端制作颤振插件时遇到错误。吊舱安装成功,然后我也可以将它们导入文件中。
我尝试使用的 pod 是Freshchat iOS SDK
我安装 pod 所遵循的步骤
启动一个新的 Flutter 插件项目。
在
.podspec
文件中添加s.dependency 'FreshchatSDK'
pod install
在example/ios
文件夹中运行。我有一个错误
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!
在我的项目中拥有,因为其他插件因此没有编译。
我添加了
s.static_framework = true
in.podspec
和use_frameworks!
inpodfile
。现在pod install
运行成功了,#import "FreshchatSDK.h"
在我的文件中添加导入后,Plugin.h
我收到了错误error: include of non-modular header inside framework module
我尝试了这个答案,但无法解决。
请帮我解决这个问题。我会尊重你的时间。
这里还有另一个颤振插件可用,但它有很多问题,一个未处理的案例使我的 iOS 应用程序崩溃,所以我想把它变成我自己的。
解决方案
由于 Target 不匹配,PodFile 中可能存在问题。当这种情况发生在我身上时,我使用了这些简单的步骤。
- 删除 Podfile
- 在特定文件中打开终端
Pod init
- 打开 Podfile 并添加依赖项
Pod install
推荐阅读
- javascript - YouTube 视频 API 片段标题包含 Next.js 中的特殊字符
- java - 如何在 JOOQ 中公开新的 SQL 函数
- jenkins - 将 allure jenkins 插件与 jenkins.groovy 集成
- maven - 确保在没有项目父 pom 的所有其他模块之前构建 maven 模块
- python - 将字符串添加到两列数据框中的重复字符串
- php - mysql查询的对称差或析取联合
- java - Java - ClassNotFoundException: java.net.http.HttpClient
- python - 一些两个字母的序列重复了 3 次?“知足”和“维持”就是这样的词
- java - 正则表达式验证包含 '=' 和 '~' 作为结束字符的字符串
- c# - Xamarin.Forms Picker ItemsSource 在 XAML 中保持为空