未找到框架 GoogleToolboxForMac

Framework not found GoogleToolboxForMac

通过 "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)

这是我的 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

有人知道这个错误吗?

我寻找 GoogleToolboxForMac 和 Firebase 之间的关系,但我只得到了一点信息。

仅供参考,我使用 Swift 2.3 和 Firebase 3.8.0。

如果您能提供任何帮助,我将不胜感激。谢谢!

GoogleToolboxForMac 是 Firebase/Messaging 的依赖项。详情在podspec。在执行 "pod update" 时,Cocoapods 应该设置您要构建的工作区和 link GoogleToolboxForMac.

听起来你的工作区有问题。 Product -> Clean 有帮助吗?如何删除派生数据和 ModuleCache(Xcode -> 首选项 -> 位置 -> 派生数据)?

这应该不是必需的,但您也可以尝试将 pod 'GoogleToolboxForMac/Logger' 显式添加到您的 Podfile。

我有同样的错误。安装 pods 后,您将看到以下消息。

[!] Please close any current Xcode sessions and use MyApp.xcworkspace for this project from now on.

我第一次没有注意到这一点,并尝试使用常规的 xcodeproj 文件构建项目。看到这个消息后,我打开了正确的项目,它运行正常。

打开此项目后,您会注意到您有两个子项目。一个是您的项目,另一个是 Pods 项目。

在我的案例中,所有集成都做得很好,也尝试了很多次删除和重新安装 pod 但没有成功。

最后尝试以下步骤

Projetc->Manage Schemes -> Select check box "Pods-MyProjectName"

并获得成功。

关闭我在安装 pod 后尝试构建的项目,然后打开 .workspace,然后一切都完美构建。

已通过在构建设置 -> 搜索 LIBRARY_SEARCH_PATHS 中添加 $(inherited) 解决此问题。

这是可以理解的,因为在为项目所依赖的最新版本的库更新 pod 文件时,调试输出会告诉您需要在何处添加所有 $(inherited) 标志: LIBRARY_SEARCH_PATHS OTHER_LD_FLAGS GCC_PREPROCESSOR_DEFINITIONS

    Friends, you must be confused with the exact result, as i was. So, i feel to share the 
screenshot that might be helpful. We all had to be careful that we need to change the flag for property **"Build Active architecture Only"** for **pod target** to **NO** And build, it would not show the linking error.

    See the attached screenshot.
    Screen Shot 1, Screen Shot 2, Screen Shot 3
    [Select Pods][1]
    [Select Targets in the pod][2]
    [Change flag to No][3]


  [1]: https://i.stack.imgur.com/E7mjX.png
  [2]: https://i.stack.imgur.com/wCwET.png
  [3]: https://i.stack.imgur.com/KVGKM.png

未找到框架

在使用Pods时,我们通常会遇到这个问题。

这主要有两个原因

  1. 当我们打开 .xcodeproj 文件而不是 .xcworkspace 时,izaaz-yunus 在这个 中提到

  2. Build Active Architecture OnlyBuild Settings[=50] 中设置为 Yes =]

    这适用于项目目标,也适用于 pod 项目中的所有目标

主要项目截图

Pod 项目截图

  1. SelectBuild Settings(主项目,pod项目两者)
  2. Select每个目标一个接一个
  3. 将每个目标的构建活动架构设置为

最后清理并重建您的项目。

在您的项目目标中打开您的-project.xcworkspace。

1) 打开终端 -> 2) $cd /project_destination -> 3) $open your-project.xcworkspace

或者直接在 finder 中打开文件

its work's
1. select your project in directories
2. select General
3. Add "GoogleToolboxForMac.framework" to the Linked "frameworks and Libraries"

确保您的项目目标和 pod 的 "Build Active Architecture settings" 相同。在这两种情况下都设置为 NO 解决了我的问题。

我在我的设备上尝试 运行 时遇到了同样的问题。在模拟器上它工作正常。我尝试了上面的一些,但它对我不起作用。我检查过我正在处理 .xcworkspace 而不是 .xcodeproj 文件,所以我尝试了这个。按照以下步骤操作:

  1. 使用 .xc... 文件打开 Xcode 项目(cocoapods 项目)。
  2. Select Pods 项目导航器中的项目(左侧蓝色图标)。
  3. 在目标下,确保选择 Pods-ProjectName(蓝色图标)。
  4. 导航到“构建设置”并设置 iOS 部署目标 iOS 您将在哪个版本上部署 运行 项目。

注:与Project->Targets->Deployment info->Deployment Target中设置的相同。

也许有人从中受益。

转到:target -> Build Settings -> Other Linker Flags -> remove framework "GoogleToolboxforMAC" 并构建项目。

我的问题是我有一个 /bin/sh 脚本复制了不存在的特定 Pods。这是其中之一。删除脚本解决了构建问题。

-我在硬盘中搜索 GoogleToolboxForMac 文件,发现于: /Users/Marco/Documents/iosapps/BomRetiro/Bom Retiro/Pods/Target 支持文件

  • 然后我将文件复制到此文件夹: /Users/YourHomeFolder/Library/Developer/Xcode/DerivedData/Bom_Retiro-bsfjbazzzuwmuidqurdmjvdtnnsb/Build/Products

然后对我来说解决了打开项目 usinf .xcworkspace 文件。

如果您遇到同样的错误,请在 XCode 中转到:

你的项目 > 你的目标 > 向下滚动到 Linked Framework and Libraries 并检查如果库条目变暗:

如果是,请删除并重新添加。就我而言,我有重复的条目,其中一个变暗(当 XCode 在磁盘上找不到它们时)。

Swift 5 个简单答案

Shift+Alt+Cmd+K  //Clean the project and Run again! 
//if not work restart Xcode and again clean it 
//Its will work happy coding

对于那些在这之后仍然有问题的人。 我正在做一个 cordova 项目,升级到 XCode 11.5.

后问题突然出现

最后我能够通过打开项目根目录中的 pods.json 文件并删除属于“FirebaseMessaging”的“库”中的条目来解决它。 我们没有使用它,我不知道它是如何到达那里的。 此外,我已将“Build Setting”->“Build Active Architecture Only”更改为“No”。

之后我再次打开 .xcworkspace 文件并构建 运行 通过。

可行的解决方案是

  • 在 xcodeproj
  • 中搜索 GoogleToolboxForMa
  • 从构建配置中删除所有引用