ios 未找到框架 GoogleToolboxForMac
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40358719/
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
Framework not found GoogleToolboxForMac
提问by bennysantoso
After I update my Firebase via "pod update", I got error like this :
通过“pod update”更新我的 Firebase 后,出现如下错误:
ld: warning: directory not found for option '-F/Users/bennysantoso/Library/Developer/Xcode/DerivedData/FCM-atfcxuircoryufazlomgwfgmvaqm/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac'
ld: framework not found GoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here my Podfile :
这是我的 Podfile :
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
target 'BB' do
# Comment this line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for BB
target 'BBTests' do
inherit! :search_paths
# Pods for testing
end
target 'BBUITests' do
inherit! :search_paths
# Pods for testing
end
end
Does anybody know about this error?
有人知道这个错误吗?
I seek out relationships GoogleToolboxForMac and Firebase, but I just get a little bit of information.
我寻找 GoogleToolboxForMac 和 Firebase 的关系,但我只得到了一点信息。
FYI, I use Swift 2.3 and Firebase 3.8.0.
仅供参考,我使用 Swift 2.3 和 Firebase 3.8.0。
I will be grateful for any help you can provide. Thanks!
如果您能提供任何帮助,我将不胜感激。谢谢!
回答by Izaaz Yunus
I had the same error. Once you install the pods, you'll see the following message.
我有同样的错误。安装 Pod 后,您将看到以下消息。
[!] Please close any current Xcode sessions and use MyApp.xcworkspace for this project from now on.
[!] 从现在开始,请关闭所有当前的 Xcode 会话并为此项目使用 MyApp.xcworkspace。
I didn't notice this for the first time and was trying to build the project using the regular xcodeproj file. After I saw this message, I opened the right project and it worked fine.
我第一次没有注意到这一点,并试图使用常规的 xcodeproj 文件构建项目。看到这条消息后,我打开了正确的项目,它运行良好。
Once you open this project you'll notice that you have two subprojects. One would be your project, and another would be the Pods project.
打开此项目后,您会注意到您有两个子项目。一个是你的项目,另一个是 Pods 项目。
回答by Vinay Kumar
Framework Not Found
未找到框架
When using Pods, we usually face this issue.
在使用 Pods 的时候,我们通常会遇到这个问题。
There are two main reasons for this
这有两个主要原因
- When we open the .xcodeprojfile instead of .xcworkspaceas mentioned by izaaz-yunus in this Answer
When Build Active Architecture Onlyis set to Yesin Build Settings
This applies to the projects target and also to all the targets in the pod project
- 当我们打开.xcodeproj文件,而不是.xcworkspace在此提到的izaaz,尤纳斯回答
当构建有源体系只有被设定为是在构建设置
这适用于项目目标以及 pod 项目中的所有目标
- Select Build Settings(of main project, pod project both)
- Select each Targetone by one
- Set Build Active Architecturesto Nofor each target
- 选择Build Settings(主项目,pod 项目)
- 一一选择每个目标
- 将每个目标的Build Active Architectures设置为No
Finally clean and rebuild your project.
最后清理并重建您的项目。
回答by iPatel
In my case all integration are well-done and also did try so many time to remove and reinstall pod but did not get success.
就我而言,所有集成都做得很好,也尝试了很多时间来删除和重新安装 pod,但没有成功。
Finally try with below step
最后尝试以下步骤
Projetc->Manage Schemes -> Select check box "Pods-MyProjectName"
Projetc->Manage Schemes -> 选择复选框“Pods-MyProjectName”
And get success.
并获得成功。
回答by Paul Beusterien
GoogleToolboxForMac is a dependency of Firebase/Messaging. Details in the podspec. When doing "pod update", Cocoapods should set up your workspace to build and link GoogleToolboxForMac.
GoogleToolboxForMac 是 Firebase/Messaging 的依赖项。podspec 中的详细信息。在执行“pod update”时,Cocoapods 应该设置您的工作区以构建和链接 GoogleToolboxForMac。
It sounds like something about your workspace is in a bad state. Does Product -> Clean help? What about deleting Derived Data and the ModuleCache (Xcode -> Preferences -> Locations -> Derived Data)?
听起来您的工作区状态不佳。产品 -> 清洁有帮助吗?删除派生数据和 ModuleCache (Xcode -> Preferences -> Locations -> Derived Data) 怎么样?
It shouldn't be necessary, but you could also try explicitly adding pod 'GoogleToolboxForMac/Logger' to your Podfile.
应该没有必要,但您也可以尝试将 pod 'GoogleToolboxForMac/Logger' 显式添加到您的 Podfile。
回答by TomV
This was fixed by adding $(inherited)in the Build Settings -> Search for LIBRARY_SEARCH_PATHS.
这是通过在 Build Settings -> Search for LIBRARY_SEARCH_PATHS 中添加$(inherited)来解决的。
This is understandable, since when updating your pod file for the latest versions of libraries which your project depends on, the debug output tells you where you need to add all the $(inherited) flags: LIBRARY_SEARCH_PATHS OTHER_LD_FLAGS GCC_PREPROCESSOR_DEFINITIONS
这是可以理解的,因为在为项目所依赖的最新版本库更新 pod 文件时,调试输出会告诉您需要在何处添加所有 $(inherited) 标志:LIBRARY_SEARCH_PATHS OTHER_LD_FLAGS GCC_PREPROCESSOR_DEFINITIONS
回答by kiran pm
its work's 1. select your project in directories 2. select General 3. Add "GoogleToolboxForMac.framework" to the Linked "frameworks and Libraries"
回答by Luiz Dias
If you're facing the same error, in your XCode, go to:
如果您遇到同样的错误,请在您的 XCode 中转到:
Your Project> your target> Scroll down to Linked Framework and Librariesand check if the Library entry is dimmed:
你的项目>你的目标> 向下滚动到Linked Framework and Libraries并检查 Library 条目是否变暗:
If so, remove and add it again. In my case, I had duplicated entries and one of them was dimmed (when XCode can't find them on disk).
如果是这样,请删除并重新添加。就我而言,我有重复的条目,其中一个变暗(当 XCode 在磁盘上找不到它们时)。
回答by Simple Maurya
I had the same issue when I tried to run it on my device. On the simulator it was working fine. I tried some of the above but it didn't work for me. I checked that I was working on .xcworkspace
instead of .xcodeproj
file, so I tried this one. Follow these steps to:
当我尝试在我的设备上运行它时,我遇到了同样的问题。在模拟器上它工作正常。我尝试了上面的一些方法,但对我不起作用。我检查过我正在处理.xcworkspace
而不是.xcodeproj
文件,所以我尝试了这个。请按照以下步骤:
- Open Xcode project (cocoapods project) using .xc... file.
- Select Pods project in the project navigator (blue icon on left).
- Under Targets, ensure Pods-ProjectName (blue icon) is selected.
- Navigate to Build Settings and set the iOS Deployment Target on which iOS version you are going to run project.
- 使用 .xc... 文件打开 Xcode 项目(cocoapods 项目)。
- 在项目导航器中选择 Pods 项目(左侧的蓝色图标)。
- 在 Targets 下,确保选择了 Pods-ProjectName(蓝色图标)。
- 导航到 Build Settings 并设置 iOS 部署目标,您将在哪个 iOS 版本上运行项目。
Note:It is same as what you set in Project->Targets->Deployment info->Deployment Target
.
注意:和你在 中设置的一样Project->Targets->Deployment info->Deployment Target
。
Maybe someone get benefitted from this.
也许有人会从中受益。
回答by Deblina Das
Go to : target -> Build Settings -> Other Linker Flags -> remove framework "GoogleToolboxforMAC"
and build the project.
转到:target -> Build Settings -> Other Linker Flags -> remove framework "GoogleToolboxforMAC"
并构建项目。
回答by Armin
My issue was that I had a /bin/sh script that copied specific Pods which didn't exist. This was one of them. Removing the script resolved the build issue.
我的问题是我有一个 /bin/sh 脚本,它复制了不存在的特定 Pod。这是其中之一。删除脚本解决了构建问题。