我最近尝试将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: /斌:/ 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-dpnxkkawmymjqihivnbvuskouynh/Build/Products/Debug-iphonesimulator/GoogleToolboxForMac -F/Users/jordanfrancis/Desktop/A/Pods/FirebaseAnalytics/Frameworks/frameworks - F /用户/ jordanfrancis /桌面/ A /荚/ FirebaseCore /框架/框架-F /用户/ jordanfrancis /桌面/ A /荚/ FirebaseInstanceID /框架/框架-F /用户/ jordanfrancis /桌面/ A /荚/ GoogleInterchangeUtilities /框架/框架-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 /框架-Xlinker -rpath -Xlinker @ loader_path /框架-Xlinker -rpath -Xlinker @ executable_path /框架-mios模拟器版本分钟= 10.2 -dead_strip -Xlinker -object_path_lto -Xlinker /用户/ jordanfrancis /库/开发商/ Xcode的/DerivedData/A-dpnxkkawmymjqihivnbvuskouynh/Build/Intermediates/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
有什么建议?干杯
就像我发布这个问题一样,我找到了解决方案......
您必须在pod安装后使用.xcworkspace文件而不是.xcodeproj文件.
为了这样做,在finder中打开项目的位置,然后用Xcode打开.xcworkspace文件(这个文件是由Cocoa Pods创建的).