我在 Swift 项目中使用 GeoFire (2.0.0(,在今天的更新 pod 之后,当项目要转到 Xcode 时,会显示clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用(在 Geofire 框架中。告诉我,我该如何解决这个问题?
我通过可可足类动物安装地球火,如下所示 pod 'GeoFire', :git => 'https://github.com/firebase/geofire-objc.git'
更新:
ld: framework not found nanopb
clang: error: linker command failed with exit code 1 (use -v to see invocation)
更新1:当我在终端中安装pods时,我可以看到此组件已使用
Using nanopb (0.3.8)
有人建议我在这里解决这个问题。
我更换了我的火力基地吊舱,它解决了地火问题。后续更新的有趣情况,事实证明,如果您使用 Geofire,则无法在高于 4.0.3 的版本中更新 Firebase
# Firebase
pod 'Firebase', '4.0.3'
pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Database'
pod 'Firebase/Storage'
# Push notification
pod 'Firebase/Core'
pod 'Firebase/Messaging'
更新:第二种方法。需要在 podfile 中写入此内容
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'GeoFire' then
target.build_configurations.each do |config|
config.build_settings['FRAMEWORK_SEARCH_PATHS'] = "#{config.build_settings['FRAMEWORK_SEARCH_PATHS']} ${PODS_ROOT}/FirebaseDatabase/Frameworks/ $PODS_CONFIGURATION_BUILD_DIR/GoogleToolboxForMac $PODS_CONFIGURATION_BUILD_DIR/nanopb"
config.build_settings['OTHER_LDFLAGS'] = "#{config.build_settings['OTHER_LDFLAGS']} -framework FirebaseDatabase"
end
end
end