[英]Install native iOS pod in flutter
I am facing an error while making a flutter plugin on the iOS side while using pods.我在使用 pod 时在 iOS 端制作 flutter 插件时遇到错误。 The pods are installed successfully then also I am able to import them in the file.
吊舱已成功安装,然后我也可以将它们导入文件中。
The pod in my case which I am trying to use is Freshchat iOS SDK我尝试使用的 Pod 是Freshchat iOS SDK
Steps I have followed to install the pod我安装 pod 所遵循的步骤
Start a new Flutter plugin project.启动一个新的 Flutter 插件项目。
In .podspec
file add s.dependency 'FreshchatSDK'
在
.podspec
文件中添加s.dependency 'FreshchatSDK'
Run pod install
in example/ios
folder.在
example/ios
文件夹中运行pod install
。
I got an error我有一个错误
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)
I removed use_frameworks!
我删除
use_frameworks!
from podfile
following this comment .来自此评论后的
podfile
。
I ran pod install
again and the pods were successfully installed and Pods
folder was created which had FreshchatSDK
folder in it.我再次运行
pod install
并成功安装了 pod,并创建了Pods
文件夹,其中FreshchatSDK
文件夹。
Now I need to have use_frameworks!
现在我需要
use_frameworks!
in my project because other plugins are not compiling because of this.在我的项目中,因为其他插件因此没有编译。
I added s.static_framework = true
in .podspec
and use_frameworks!
我在
.podspec
和 use_frameworks 中添加了s.static_framework = true
use_frameworks!
in podfile
.在
podfile
中。 Now pod install
ran successfully,现在
pod install
运行成功,
After I added the import #import "FreshchatSDK.h"
in my Plugin.h
file I got the error在我的
Plugin.h
文件中添加 import #import "FreshchatSDK.h"
后,出现错误
error: include of non-modular header inside framework module
I tried this answer but was not able to resolve it.我尝试了这个答案,但无法解决。
Please help me resolve this.请帮我解决这个问题。 I'll be respectful of your time.
我会尊重你的时间。
There is another flutter plugin available here but it has many issues and one unhandled case is making my iOS app crash so I want to make it my own.这里还有另一个 flutter 插件,但它有很多问题,一个未处理的案例导致我的 iOS 应用程序崩溃,所以我想把它变成我自己的。
There may be problems in the PodFile due to unmatched Targets.由于不匹配的目标,PodFile 中可能存在问题。 When this happens to me, I used these simple steps.
当我遇到这种情况时,我使用了这些简单的步骤。
Pod init
Pod install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.