ld:找不到-lGoogleToolboxForMac的库

War*_*olf 10 objective-c google-toolbox-for-mac firebase-cloud-messaging xcode8.1

我正在通过pod实现firebase设置.

我的Pods文件看起来像是一个.

# Uncomment the next line to define a global platform for your project
platform :ios, '8.0'
# $(PROJECT_DIR)/build/Debug-iphoneos/GoogleToolboxForMac lib search path
target 'ProductName' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for mCura

pod 'Firebase/Core'
pod 'Firebase/Messaging'

end
Run Code Online (Sandbox Code Playgroud)

iPad模拟器一切都很好.它的运行,但当我在iDevice中运行我的应用程序.它显示找不到库.

ld: library not found for -lGoogleToolboxForMac
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)

我已经浪费了2天来消除这个错误并尝试了我能在网上找到的一切.GoogleToolboxForMac安装firebase pod时,库会自动安装.

War*_*olf 16

我将我的pod文件更改为以下代码并重新安装pod.它为GoogleToolboxForMac安装了所有必需的文件.

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'ProductName' do

  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'GoogleToolboxForMac', '~> 2.1'

end
Run Code Online (Sandbox Code Playgroud)

安装pod之后

1)将方案更改为通用iOS设备和构建.

2)构建成功后,您可以看到黑色而不是红色的libGoogleToolboxForMac.a文件.

3)现在选择Device并在iDevice上运行build.关注截图.

在此输入图像描述

或者您可以构建库libGoogleToolboxForMac.a


Sun*_*all 13

我也得到了这个例外:

在此输入图像描述

在Xcode中打开/ platform/ios文件夹而不是/platform/ios/MyApp.xcodeproj文件后修复了它.


小智 9

我遇到了同样的错误,只需从.xcworkspace文件而不是.xcodeproj.