ios ld:框架未找到 Pods
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29865899/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ld: framework not found Pods
提问by Ka?ris
I'm trying to add a framework to my IOS project but when I build I always got the same message :
我正在尝试向我的 IOS 项目添加一个框架,但是当我构建时,我总是收到相同的消息:
ld: framework not found Pods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld:框架未找到 Pods
clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
I tried to remove my Pods
directory and then run pod install
I open the .xcworkspace
like it is written in the logs on the pod install, I clean the project on xcode and then try to build but it won't works..
我尝试删除我的Pods
目录,然后运行pod install
我打开.xcworkspace
它,就像它写在 pod install 的日志中一样,我在 xcode 上清理了项目,然后尝试构建,但它不起作用..
My podfile looks like this :
我的 podfile 看起来像这样:
xcodeproj '/Users/guillaume/project/Mobile/iOS/FoodPin/FoodPin.xcodeproj'
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'SwiftHTTP', '~> 0.9.2'
My version of xcode is 6.3.1
我的 xcode 版本是 6.3.1
Thank you,
谢谢,
回答by Arbitur
In Project Navigator
in the folder Pods
I had a Pods.framework
in there which was red. It was also present in Linked Frameworks and Libraries
. I removed both references and the error disappeared.
在Project Navigator
文件夹中,Pods
我有一个Pods.framework
红色的。它也出现在Linked Frameworks and Libraries
. 我删除了两个引用,错误消失了。
TL;DR
TL; 博士
Remove Pods.framework
in:
删除Pods.framework
:
- Folder named
Pods
Linked Frameworks and Libraries
- 文件夹命名
Pods
Linked Frameworks and Libraries
回答by Chris Trevarthen
This is usually caused by having the .xcodeproj file open instead of .xcworkspace.
这通常是由于打开了 .xcodeproj 文件而不是 .xcworkspace 引起的。
When you run 'pod install' for the first time, it will create an .xcworkspace file, which includes your original .xcodeproj and a Pods project. You'll need to close your .xcodeproj and open the .xcworkspace instead.
当您第一次运行“pod install”时,它会创建一个 .xcworkspace 文件,其中包含您的原始 .xcodeproj 和一个 Pods 项目。您需要关闭 .xcodeproj 并打开 .xcworkspace。
This is a common issue when creating a project through Xcode's new project wizard - I often forget that I'm not in a workspace, which is required to get Cocoapods to link correctly.
这是通过 Xcode 的新项目向导创建项目时的常见问题 - 我经常忘记我不在工作区中,这是让 Cocoapods 正确链接所必需的。
回答by Ted
Xcode 9, 10, 11
Xcode 9、10、11
install https://github.com/CocoaPods/cocoapods-deintegrate
安装https://github.com/CocoaPods/cocoapods-deintegrate
pod deintegrate
then
然后
pod install
回答by theblang
I cleared this error by deleting the red .framework
files that were located in a folder Frameworks
in the project navigator
. I think this also automatically deleted corresponding red entries in the Linked Frameworks and Libraries
section of the General
settings.
我通过删除红色清除此错误.framework
是位于一个文件夹中的文件Frameworks
中project navigator
。我想这也自动删除Linked Frameworks and Libraries
了General
设置部分中相应的红色条目。
I have been cleaning / reinstalling pods in order to fix another issue. Perhaps these red framework files and entries were just leftover from a previous pod install?
我一直在清洁/重新安装 Pod 以解决另一个问题。也许这些红色框架文件和条目只是之前 pod 安装的剩余部分?
回答by calebeaires
For who find this issue. I am using NativeScript and got the same error.
对于谁发现这个问题。我正在使用 NativeScript 并遇到相同的错误。
That happen becouse I opened the file .xcodeproj, but we must open the project by the file .xcworkspace.
这是因为我打开了文件 .xcodeproj,但我们必须通过文件 .xcworkspace 打开项目。
回答by Elliott Davies
This happened to me after updating my Podfile and doing a pod update.
在更新我的 Podfile 并进行 Pod 更新后,这发生在我身上。
For some reason, I had a "Pods_[ProjectName]".framework file appear under my project under 'Targets' > General > Linked Frameworks and Libraries.
出于某种原因,我在“目标”>“常规”>“链接的框架和库”下的项目下出现了一个“Pods_[ProjectName]”.framework 文件。
Deleting this and then clean/rebuilding fixed the issue.
删除它然后清理/重建解决了这个问题。
回答by Sharukh Mastan
I had a similar issue as
我有一个类似的问题
framework not found Pods_OneSignalNotificationServiceExtension
It was resolved by removing the following. Go to targetOneSignalNotificationServiceExtension > Build Phases > Link Binary with Libraries and deleting Pods_OneSignalNotificationServiceExtension.frameworkHope this helps. Cheers.
通过删除以下内容已解决。转到目标OneSignalNotificationServiceExtension > Build Phases > Link Binary with Libraries 并删除Pods_OneSignalNotificationServiceExtension.framework希望这会有所帮助。干杯。
回答by osama
I was getting this error because i renamed my project and change the name of project in pod file too but my project was referring to old name which was not there and causing this error . I get rid of this by
我收到此错误是因为我重命名了我的项目并更改了 pod 文件中的项目名称,但我的项目指的是不存在的旧名称并导致此错误。我摆脱了这个
pod deintegrate
followed by
其次是
pod install