简体   繁体   English

尝试构建存档Xcode时出错:clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

[英]Error from trying to build archive Xcode: clang: error: linker command failed with exit code 1 (use -v to see invocation)

I recently updated my Xcode and reinstalled an older version for an app that is built on an older version of Xcode. 我最近更新了Xcode,并为基于旧版本Xcode构建的应用程序重新安装了旧版本。

So I now have Xcode 10 as well as Xcode 9.2 installed on my computer. 因此,我现在在计算机上安装了Xcode 10和Xcode 9.2。

I have set the default in the command line to Xcode 9.2, I have changed the location to Xcode 9.2 我在命令行中将默认值设置为Xcode 9.2,将位置更改为Xcode 9.2

I have tried to load Name.xcworkspace as opposed to Name.xcodeproj in finder. 我试图在finder中加载Name.xcworkspace而不是Name.xcodeproj。

I have tried deintegrating and reinstalling my Cocoapods 我尝试拆解并重新安装我的Cocoapods

And yet I keep getting this error whenever I try to build an archive. 但是,无论何时尝试建立存档,我都会不断收到此错误。

What else can I try? 我还能尝试什么? I need to push a new build to the App Store, and with this bug, I can't at all. 我需要将新的版本推送到App Store,并且由于这个错误,我根本无法。

I am also noticing that Jump to Definition does not work either, so I am assuming there must be some relationship here. 我还注意到跳转到定义也不起作用,因此我假设此处必须存在某种关系。

That being said, development versions of the app build fine for the simulator. 话虽这么说,该应用程序的开发版本可以很好地模拟模拟器。

What else could be going wrong here? 还有什么地方出问题了? How do I fix this? 我该如何解决?

I've seen some questions about this, but I have done everything those other questions ask 我已经看到了一些与此有关的问题,但是我已经做了其他所有其他问题

Full error log: 完整的错误日志:

Ld /Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/IntermediateBuildFilesPath/Candy.build/Release-iphoneos/Candy.build/Objects-normal/armv7/Candy normal armv7
    cd /Users/andy/Desktop/Projects/pinyada-final/candy/Candy
    export IPHONEOS_DEPLOYMENT_TARGET=10.0
    export PATH="/Applications/Xcode 9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode 9.2.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode\ 9.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode\ 9.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -L/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos -L/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/CardIO/CardIO -L/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/GoogleAnalytics/Libraries -L/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/PayPal-iOS-SDK/PayPalMobile -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/ARChromeActivity -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/AeroGearHttp -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/AeroGearOAuth2 -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/Alamofire -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/AlamofireNetworkActivityIndicator -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/Bolts -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/EAIntroView -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/EARestrictedScrollView -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/EmitterKit -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/Eureka -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/FBSDKCoreKit -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/FBSDKLoginKit -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/FBSDKShareKit -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/FacebookCore -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/FacebookLogin -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/FacebookShare -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/GMStepper -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/GoogleToolboxForMac -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/KINWebBrowser -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/Koloda -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/PKHUD -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/SimpleKeychain -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/SnapKit -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/SwiftyJSON -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/TUSafariActivity -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/Unbox -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/UnboxedAlamofire -F/Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos/pop -F/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/AppsFlyerFramework -F/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/Button -F/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/FirebaseAnalytics/Frameworks -F/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/FirebaseCore/Frameworks -F/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/FirebaseInstanceID/Frameworks -F/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/Google/Frameworks -F/Users/andy/Desktop/Projects/pinyada-final/candy/Candy/Pods/Pushwoosh/Framework -filelist /Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/IntermediateBuildFilesPath/Candy.build/Release-iphoneos/Candy.build/Objects-normal/armv7/Candy.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=10.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/IntermediateBuildFilesPath/Candy.build/Release-iphoneos/Candy.build/Objects-normal/armv7/Candy_lto.o -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/BuildProductsPath/Release-iphoneos -Xlinker -final_output -Xlinker /Applications/Candy.app/Candy -fobjc-link-runtime -L/Applications/Xcode\ 9.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker /Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/IntermediateBuildFilesPath/Candy.build/Release-iphoneos/Candy.build/Objects-normal/armv7/Candy.swiftmodule -ObjC -lCardIO -lGoogleAnalytics -lPayPalMobile -lc++ -lopencv_core -lopencv_imgproc -lsqlite3 -lstdc++ -lz -framework ARChromeActivity -framework AVFoundation -framework Accelerate -framework AdSupport -framework AddressBook -framework AeroGearHttp -framework AeroGearOAuth2 -framework Alamofire -framework AlamofireNetworkActivityIndicator -framework AppsFlyerLib -framework AssetsLibrary -framework AudioToolbox -framework Bolts -framework Button -framework CoreData -framework CoreFoundation -framework CoreLocation -framework CoreMedia -framework CoreMotion -framework CoreVideo -framework EAIntroView -framework EARestrictedScrollView -framework EmitterKit -framework Eureka -framework FBSDKCoreKit -framework FBSDKLoginKit -framework FBSDKShareKit -framework FacebookCore -framework FacebookLogin -framework FacebookShare -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseInstanceID -framework GGLAnalytics -framework GGLCore -framework GMStepper -framework GoogleToolboxForMac -framework KINWebBrowser -framework Koloda -framework MessageUI -framework MobileCoreServices -framework OpenGLES -framework PKHUD -framework Pushwoosh -framework QuartzCore -framework Security -framework SimpleKeychain -framework SnapKit -framework StoreKit -framework SwiftyJSON -framework SystemConfiguration -framework TUSafariActivity -framework UIKit -framework Unbox -framework UnboxedAlamofire -framework iAd -framework pop -framework AdSupport -framework iAd -framework Pods_Candy -Xlinker -dependency_info -Xlinker /Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/IntermediateBuildFilesPath/Candy.build/Release-iphoneos/Candy.build/Objects-normal/armv7/Candy_dependency_info.dat -o /Users/andy/Library/Developer/Xcode/DerivedData/Candy-dcszzxlovxhznvggxxjbcwvojdkc/Build/Intermediates.noindex/ArchiveIntermediates/Candy/IntermediateBuildFilesPath/Candy.build/Release-iphoneos/Candy.build/Objects-normal/armv7/Candy

ld: warning: Some object files have incompatible Objective-C category definitions. Some category metadata may be lost. All files containing Objective-C categories should be built using the same compiler.
ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1000.11.45.2_0' Reader: '900.0.39.2_0')', using libLTO version 'LLVM version 9.0.0, (clang-900.0.39.2)' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

转到xCode> Prefrences>位置,然后删除所有存档和派生数据,进行干净的构建即可。

When you build your project, Xcode invokes clang for Objective-C targets and swift/swiftc for Swift targets. 在生成项目时,Xcode会为Objective-C目标调用clang,并为Swift目标调用swift / swiftc。 Both of these compilers compile the app to an intermediate representation (IR), one of these IRs is bitcode. 这两个编译器都将应用程序编译为中间表示(IR),这些IR之一是位码。 From this IR, a program called LLVM takes over and creates the binaries needed for x86 32 and 64 bit modes (for the simulator) and arm6/arm7/arm7s/arm64 (for the device). 通过此IR,一个名为LLVM的程序将接管并创建x86 32位和64位模式(对于模拟器)和arm6 / arm7 / arm7s / arm64(对于设备)所需的二进制文件。 Normally, all of these different binaries are lumped together in a single file called a fat binary. 通常,所有这些不同的二进制文件都集中在一个称为胖二进制文件的文件中。

The ENABLE_BITCODE option cuts out this final step. ENABLE_BITCODE选项完成了最后一步。 It creates a version of the app with an IR bitcode binary. 它使用IR位码二进制文件创建该应用程序的版本。 This has a number of nice features, but one giant drawback: it can't run anywhere. 它具有许多不错的功能,但有一个巨大的缺点:它无法在任何地方运行。 In order to get an app with a bitcode binary to run, the bitcode needs to be recompiled (maybe assembled or transcoded… I'm not sure of the correct verb) into an x86 or ARM binary. 为了使带有位代码二进制文件的应用程序能够运行,需要将位代码重新编译(可能是汇编的或转码的……我不确定正确的动词),将其编译为x86或ARM二进制文件。

Now, in your case some third party library must have bitcode disabled and hence you will also need you disable bitcode in your project. 现在,在您的情况下,某些第三方库必须禁用了位代码,因此您还需要在项目中禁用位代码。 @Andrew @安德鲁

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 xcode中的错误:clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) - error in xcode : clang: error: linker command failed with exit code 1 (use -v to see invocation) Xcode 5- clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) - Xcode 5- clang: error: linker command failed with exit code 1 (use -v to see invocation) 修复-Xcode 9.1-铛:错误:链接器命令失败,退出代码为1(使用-v查看调用) - Fix - Xcode 9.1 - clang: error: linker command failed with exit code 1 (use -v to see invocation) clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)Xcode 9 - clang: error: linker command failed with exit code 1 (use -v to see invocation) Xcode 9 clang:错误:在xcode上进行单元测试时,链接器命令失败,退出代码为1(使用-v查看调用) - clang: error: linker command failed with exit code 1 (use -v to see invocation) when doing unit test on xcode 铛:错误:链接器命令失败,在xcode 6中退出代码为1(使用-v查看调用) - clang: error: linker command failed with exit code 1 (use -v to see invocation) in xcode 6 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)Xcode 10.2.1 - clang: error: linker command failed with exit code 1 (use -v to see invocation) Xcode 10.2.1 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)Xcode - clang: error: linker command failed with exit code 1 (use -v to see invocation) Xcode Xcode 5 - clang:错误:链接器命令失败,退出代码为1(使用-v查看调用) - Xcode 5 - clang: error: linker command failed with exit code 1 (use -v to see invocation) clang:错误:Xcode 10.0和Ionic 3中的链接器命令失败,退出代码为1(使用-v查看调用) - clang: error: linker command failed with exit code 1 (use -v to see invocation) in Xcode 10.0 and Ionic 3
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM