Xcode 9.4.1:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
Posted
技术标签:
【中文标题】Xcode 9.4.1:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)【英文标题】:Xcode 9.4.1: error: linker command failed with exit code 1 (use -v to see invocation) 【发布时间】:2018-10-30 14:22:05 【问题描述】:我有 ios Cordova 项目,我想将 Firebase In-App Messaging 安装到我的项目中,我的 pod 文件如下所示:
platform :ios, '10.0'
target 'Feel Better' do
project 'Feel Better.xcodeproj'
pod 'Firebase/Core', '~> 4.1'
pod 'Firebase/DynamicLinks', '~> 4.1'
pod 'Fabric', '~> 1.7.11'
pod 'Crashlytics', '~> 3.10.7'
end
我按照 firebase 文档中的说明进行操作: https://firebase.google.com/docs/in-app-messaging/get-started
我删除了 Firebase/Core 和 Firebase/DynamicLinks 库并添加了 Firebase 现在我的 pod 文件如下所示:
platform :ios, '10.0'
target 'Feel Better' do
project 'Feel Better.xcodeproj'
pod 'Fabric', '~> 1.7.11'
pod 'Crashlytics', '~> 3.10.7'
pod 'Firebase'
pod 'Firebase/InAppMessagingDisplay'
end
当我构建应用程序时,我收到了这个错误:
Ld /Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/Feel\ Better.app/Feel\ Better normal arm64
cd /Users/abdullahal-hallak/Desktop/ios_build_feel/ios
export IPHONEOS_DEPLOYMENT_TARGET=10.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.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 arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.4.sdk -L/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos -L/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/FirebaseCore -L/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/FirebaseInAppMessagingDisplay -L/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/GoogleUtilities -L/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/nanopb -L/Users/abdullahal-hallak/Desktop/ios_build_feel/ios/Feel\ Better/Plugins/cordova-plugin-extension -L/Users/abdullahal-hallak/Desktop/ios_build_feel/ios/Feel\ Better/Plugins/cordova-plugin-google-analytics -F/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos -F/Users/abdullahal-hallak/Desktop/ios_build_feel/ios/Pods/Crashlytics/iOS -F/Users/abdullahal-hallak/Desktop/ios_build_feel/ios/Pods/Fabric/iOS -F/Users/abdullahal-hallak/Desktop/ios_build_feel/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/abdullahal-hallak/Desktop/ios_build_feel/ios/Pods/FirebaseInAppMessaging/Frameworks -F/Users/abdullahal-hallak/Desktop/ios_build_feel/ios/Pods/FirebaseInstanceID/Frameworks -F/Users/abdullahal-hallak/Desktop/ios_build_feel/ios/Pods/GoogleAppMeasurement/Frameworks -FFeel\ Better/Plugins/cordova-plugin-admobpro -FFeel\ Better/Plugins/cordova-plugin-googleplus -FFeel\ Better/Plugins/cordova-plugin-firebase -FFeel\ Better/Plugins/cordova-plugin-facebook4 -filelist /Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Intermediates.noindex/Feel\ Better.build/Debug-iphoneos/Feel\ Better.build/Objects-normal/arm64/Feel\ Better.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=10.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Intermediates.noindex/Feel\ Better.build/Debug-iphoneos/Feel\ Better.build/Objects-normal/arm64/Feel\ Better_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -ObjC -ObjC -lFirebaseCore -lFirebaseInAppMessagingDisplay -lGoogleUtilities -lc++ -lnanopb -lsqlite3 -lz -framework Crashlytics -framework FIRAnalyticsConnector -framework Fabric -framework FirebaseAnalytics -framework FirebaseCoreDiagnostics -framework FirebaseInAppMessaging -framework FirebaseInstanceID -framework Foundation -framework GoogleAppMeasurement -framework Security -framework StoreKit -framework SystemConfiguration -framework UIKit /Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/libCordova.a -lCordovaGenericAd -framework CFNetwork -framework GoogleMobileAds -framework AdSupport -framework AudioToolbox -framework AVFoundation -framework CoreBluetooth -framework CoreLocation -framework CoreMedia -framework CoreMotion -framework CoreTelephony -framework CoreVideo -framework EventKit -framework EventKitUI -framework Foundation -framework GLKit -framework MediaPlayer -framework MessageUI -framework OpenGLES -framework SafariServices -framework StoreKit -framework SystemConfiguration -framework UIKit -lz -lGoogleAnalyticsServices -lAdIdAccess -framework CoreData -lz -lsqlite3 -framework GoogleAppUtilities -framework GoogleAuthUtilities -framework GoogleNetworkingUtilities -framework GoogleSignIn -framework GoogleSymbolUtilities -framework GoogleUtilities -weak_framework AddressBook -weak_framework CoreText -weak_framework Security -weak_framework WebKit -weak_framework Social -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseInstanceID -framework FirebaseNanoPB -framework GoogleToolboxForMac -framework nanopb -framework Protobuf -framework FirebaseMessaging -framework FirebaseCrash -framework FirebaseRemoteConfig -framework FirebaseABTesting -framework FirebaseAuth -framework GTMSessionFetcher -framework FirebasePerformance -framework FirebaseSwizzlingUtilities -framework Bolts -framework FBSDKCoreKit -framework FBSDKLoginKit -framework FBSDKShareKit -lPods-Feel\ Better -Xlinker -dependency_info -Xlinker /Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Intermediates.noindex/Feel\ Better.build/Debug-iphoneos/Feel\ Better.build/Objects-normal/arm64/Feel\ Better_dependency_info.dat -o /Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/Feel\ Better.app/Feel\ Better
duplicate symbol _OBJC_IVAR_$_FIROptions._deepLinkURLScheme in:
/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/FirebaseCore/libFirebaseCore.a(FIROptions.o)
Feel Better/Plugins/cordova-plugin-firebase/FirebaseCore.framework/FirebaseCore(FIROptions_fea8468bc833c6b2fdfc4e3e41e62ab3.o)
duplicate symbol _kServiceInfoFileName in:
/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/FirebaseCore/libFirebaseCore.a(FIROptions.o)
Feel Better/Plugins/cordova-plugin-firebase/FirebaseCore.framework/FirebaseCore(FIROptions_fea8468bc833c6b2fdfc4e3e41e62ab3.o)
duplicate symbol _OBJC_IVAR_$_FIROptions._editingLocked in:
/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/FirebaseCore/libFirebaseCore.a(FIROptions.o)
Feel Better/Plugins/cordova-plugin-firebase/FirebaseCore.framework/FirebaseCore(FIROptions_fea8468bc833c6b2fdfc4e3e41e62ab3.o)
duplicate symbol _kFIRLibraryVersionID in:
/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/FirebaseCore/libFirebaseCore.a(FIROptions.o)
Feel Better/Plugins/cordova-plugin-firebase/FirebaseCore.framework/FirebaseCore(FIROptions_fea8468bc833c6b2fdfc4e3e41e62ab3.o)
duplicate symbol _OBJC_CLASS_$_PodsDummy_nanopb in:
/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/nanopb/libnanopb.a(nanopb-dummy.o)
Feel Better/Plugins/cordova-plugin-firebase/nanopb.framework/nanopb(nanopb-dummy.o)
duplicate symbol _OBJC_METACLASS_$_PodsDummy_nanopb in:
/Users/abdullahal-hallak/Library/Developer/Xcode/DerivedData/Feel_Better-cbsuzdzkqclgrzeouyqnplriftff/Build/Products/Debug-iphoneos/nanopb/libnanopb.a(nanopb-dummy.o)
Feel Better/Plugins/cordova-plugin-firebase/nanopb.framework/nanopb(nanopb-dummy.o)
ld: 108 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
【问题讨论】:
【参考方案1】:我昨天遇到了这个错误,
我发现当你change your team name from "XYZ" to "None"
链接器错误解决了。enter image description here
查看此链接以供参考,您可以在其中找到应用程序主页的屏幕截图。
【讨论】:
【参考方案2】:我确实删除了安装在 pod 项目中的项目的重复框架,并且一切正常。
【讨论】:
以上是关于Xcode 9.4.1:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)的主要内容,如果未能解决你的问题,请参考以下文章
错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)xcode 错误?
Xcode 5- clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
Xcode构建错误链接器命令失败,退出代码为1(使用-v查看调用)
Flutter Xcode:clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)