使用Cocoapods添加Firebase时Apple Mach-O链接器错误组

问题描述 投票:1回答:3

我最近尝试将Firebase添加到我的应用程序中。使用Cocoapods我做了一个

pod init

和a

pod install

这是我的Podfile:

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

target 'A' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for A
pod ‘Firebase’
end

在尝试构建我的应用程序时,我收到以下错误:

Apple Mach-O链接器错误组

Ld /Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Products/Debug-iphonesimulator/A.app/A normal x86_64 cd / Users / jordanfrancis / Desktop / A export IPHONEOS_DEPLOYMENT_TARGET = 10.2 export PATH =“ /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin: / bin:/ usr / sbin:/ sbin“/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms /iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.2.sdk -L / Users / jordanfrancis / Library / Developer / Xcode / DerivedData / A-dpnxkkawmymjqihivnbvuskouynh / Build / Products / Debug-iphonesimulator -F / Users / jordanfrancis / Library / Developer / Xcode / DerivedData / A-dpnxkkawmymjqihivnbvuskouynh / Build / Products / Debug-iphonesimulator -F / Users / jordanfrancis / Library / Developer / Xcode / DerivedData / A-dpnxkkawmymjqihivnbvusk ouynh / Build / Products / Debug-iphonesimulator / GoogleToolboxForMac -F / Users / jordanfrancis / Desktop / A / Pods / FirebaseAnalytics / Frameworks / frameworks -F / Users / jordanfrancis / Desktop / A / Pods / FirebaseCore / Frameworks / frameworks -F / Users / jordanfrancis / Desktop / A / Pods / FirebaseInstanceID / Frameworks / frameworks -F / Users / jordanfrancis / Desktop / A / Pods / GoogleInterchangeUtilities / Frameworks / frameworks -F / Users / jordanfrancis / Desktop / A / Pods / GoogleSymbolUtilities / Frameworks / frameworks -filelist /Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Intermediates/A.build/Debug-iphonesimulator/A.build/Objects-normal/x86_64/A.LinkFileList -Xlinker -rpath - Xlinker @ executable_path / Frameworks -Xlinker -rpath -Xlinker @ loader_path / Frameworks -Xlinker -rpath -Xlinker @ executable_path / Frameworks -mios-simulator-version-min = 10.2 -dead_strip -Xlinker -object_path_lto -Xlinker / Users / jordanfrancis / Library /开发商/ Xcode中/ DerivedData / A-dpnxkkawmymjqihivnbvuskouynh /编译/中间体/ A。 build / Debug-iphonesimulator / A.build / Objects-normal / x86_64 / A_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -L / Applications / Xcode.app / Contents /Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Intermediates/A.build/Debug-iphonesimulator /A.build/Objects-normal/x86_64/A.swiftmodule -ObjC -lc ++ -lsqlite3 -lz -framework AddressBook -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseInstanceID -framework GoogleInterchangeUtilities -framework GoogleSymbolUtilities -framework GoogleToolboxForMac -framework StoreKit -framework SystemConfiguration - Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Intermediates/A.build/Debug-iphonesimulator/A.build/ A.app.xcent -framework Pods_A -Xlinker -dependency_info -Xlinker /Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Intermediates/A.build/Debug-iphonesimulator/A.build/Objects-normal /x86_64/A_dependency_info.dat -o /Users/jordanfrancis/Library/Developer/Xcode/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Products/Debug-iphonesimulator/A.app/A

ld:警告:找不到选项'-F / Users / jordanfrancis / Library / Developer / Xcode / DerivedData / A-dpnxkkawmymjqihivnbvuskouynh / Build / Products / Debug-iphonesimulator / GoogleToolboxForMac'ld:找不到框架GoogleToolboxForMac clang:error:linker命令失败,退出代码为1(使用-v查看调用)

我使用的是Swift 3.0

有什么建议?干杯

ios swift xcode firebase cocoapods
3个回答
9
投票

就像我发布这个问题一样,我找到了解决方案......

您必须在pod安装后使用.xcworkspace文件而不是.xcodeproj文件。

为了这样做,在finder中打开项目的位置,然后用Xcode打开.xcworkspace文件(这个文件是由Cocoa Pods创建的)。


0
投票

我刚刚遇到了与我的新项目相同的问题,在尝试了很多事情之后,我终于通过更新我的pod解决了我的问题:

pod update
Installing Firebase 4.7.0 (was 4.1.1)
Installing FirebaseAnalytics 4.0.5 (was 4.0.3)
Installing FirebaseCore 4.0.12 (was 4.0.6)
Installing FirebaseInstanceID 2.0.7 (was 2.0.2)
Installing GoogleToolboxForMac 2.1.3 (was 2.1.1)

从Xcode清理你的项目,也(如果还不够)清除Library - > Developer - > Xcode-> DerivedData文件夹并尝试重建你的项目。


-6
投票

在终端中尝试这个:

  • git状态
  • git branch
  • git add -A
  • git commit -m''你的评论......''
  • git push origin(您的分支名称)
© www.soinside.com 2019 - 2024. All rights reserved.