5

我正在通过pod实施Firebase设置。ld:找不到-lGoogleToolboxForMac的库

我的豆荚文件看起来像下面的文件。

# 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 

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

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

我已经浪费了2天的时间消除这种错误&什么都试过了我能找到的净。在安装Firebase窗格时,会自动安装GoogleToolboxForMac库。

回答

11

我将我的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 

安装荚

1后)变更计划,以通用的iOS设备和建设。

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

3)现在选择设备并在iDevice上运行构建。按照截图。

enter image description here

或者,您可以构建库libGoogleToolboxForMac.a

+0

是对的。谢谢! – chaunv

1

我也收到此异常:

enter image description here

它固定在Xcode打开/平台/ IOS文件夹而不是之后/platform/ios/MyApp.xcodeproj文件。