libraries for bitcode must be generated from Xcode Archive or Install build forARM7 解决办法

本文详细介绍了在使用Xcode7.2开发环境时,遇到第三方库在打包上传商店时报错Bitcodebundlecouldnotbegenerated的问题,并提供了更新库和关闭Bitcode两种解决方法。

开发环境 :Xcode7.2

开发语言:OC

场景:工程中 引入第三方静态库  真机调试没有问题,但是在打包上传商店的时候报错





报错:


问题详情:

 Bitcode bundle could not be generated because '/Users/ws/Desktop/Build/Intermediates/ArchiveIntermediates/G2-JEWELRY/BuildProductsPath/Release-iphoneos/libNDL-LIB-G2-CORE.a(POSSDK.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture armv7


由上述问题看出第三方库不兼容 XCode7later 之后默认开启BitCode


解决办法:


1.更新library使包含Bitcode,否则会出现以上问题。 
2.关闭Bitcode,简单粗暴。

解决实现:

1、更新换库


2、解决方法步骤

选择工程之后再Build  settings标签 中的 build optional 查看Enable bitCode  选项改为NO 


Ld /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/ProductName normal (in target 'Unity-iPhone' from project 'Unity-iPhone') cd /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -Xlinker -reproducible -target arm64-apple-ios14.9 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.4.sdk -Os -L/Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/EagerLinkingTBDs/Release-iphoneos -L/Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos -L/Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Unity-iPhone -F/Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/EagerLinkingTBDs/Release-iphoneos -F/Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos -filelist /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/ProductName.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -map -Xlinker /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/ProductName-LinkMap-normal-arm64.txt -dead_strip -Xlinker -object_path_lto -Xlinker /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/ProductName_lto.o -Xlinker -final_output -Xlinker /Applications/ProductName.app/ProductName -Xlinker -dependency_info -Xlinker /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/Objects-normal/arm64/ProductName_dependency_info.dat -stdlib\=libc++ -fobjc-arc -fobjc-link-runtime -ObjC -framework Pods_Unity_iPhone -framework AdSupport -framework CoreTelephony -framework AppTrackingTransparency -framework AdServices -framework LocalAuthentication -framework WebKit -framework AuthenticationServices -framework JavaScriptCore -weak_framework Network -weak_framework SafariServices -weak_framework MapKit -weak_framework Accounts -weak_framework Accelerate -lsqlite3.0 -lc++ -lz -Xlinker -no_adhoc_codesign -o /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/ProductName ld: warning: ignoring duplicate libraries: '-lc++' LinkAssetCatalog /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Unity-iPhone/Images.xcassets (in target 'Unity-iPhone' from project 'Unity-iPhone') cd /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild builtin-linkAssetCatalog --thinned /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_output/thinned --thinned-dependencies /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_dependencies_thinned --thinned-info-plist-content /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_generated_info.plist_thinned --unthinned /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_output/unthinned --unthinned-dependencies /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_dependencies_unthinned --unthinned-info-plist-content /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_generated_info.plist_unthinned --output /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app --plist-output /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/Unity-iPhone.build/Release-iphoneos/Unity-iPhone.build/assetcatalog_generated_info.plist note: Emplaced /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/AppIcon60x60@2x.png (in target 'Unity-iPhone' from project 'Unity-iPhone') note: Emplaced /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Assets.car (in target 'Unity-iPhone' from project 'Unity-iPhone') note: Emplaced /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/AppIcon76x76@2x~ipad.png (in target 'Unity-iPhone' from project 'Unity-iPhone') Copy /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UnityFramework.framework /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/UnityFramework.framework (in target 'Unity-iPhone' from project 'Unity-iPhone') cd /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -exclude Headers -exclude PrivateHeaders -exclude Modules -exclude \*.tbd -strip-unsigned-binaries -strip-deterministic -bitcode-strip all -bitcode-strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks -remove-static-executable /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/BuildProductsPath/Release-iphoneos/UnityFramework.framework /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -D -S -no_atom_info /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/UnityFramework.framework/UnityFramework -o /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UnityFramework.framework/UnityFramework/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UnityFramework.framework/UnityFramework -r -o /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UnityFramework.framework/UnityFramework Copy /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UltraGlobalSDK.framework /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Frameworks/Plugins/iOS/UltraGlobalSDK.framework (in target 'Unity-iPhone' from project 'Unity-iPhone') cd /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -exclude Headers -exclude PrivateHeaders -exclude Modules -exclude \*.tbd -strip-unsigned-binaries -strip-deterministic -bitcode-strip all -bitcode-strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks -remove-static-executable /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Frameworks/Plugins/iOS/UltraGlobalSDK.framework /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -D -S -no_atom_info /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Frameworks/Plugins/iOS/UltraGlobalSDK.framework/UltraGlobalSDK -o /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UltraGlobalSDK.framework/UltraGlobalSDK/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/bitcode_strip /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UltraGlobalSDK.framework/UltraGlobalSDK -r -o /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UltraGlobalSDK.framework/UltraGlobalSDK CodeSign /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UltraGlobalSDK.framework (in target 'Unity-iPhone' from project 'Unity-iPhone') cd /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild Signing Identity: "iPhone Distribution: Aniplex Inc. (8ARKQ2E7H5)" Provisioning Profile: "Blue Exorcist Japanese New Distribution" (ac68be12-e3de-4bbd-8f79-5f18bc0d517f) /usr/bin/codesign --force --sign 1120F5C9E9CA86E8B4AF44096D7274F82BB265FA --preserve-metadata\=identifier,entitlements,flags --generate-entitlement-der /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UltraGlobalSDK.framework /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UltraGlobalSDK.framework: errSecInternalComponent Command CodeSign failed with a nonzero exit code /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'Firebase' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'Firebase' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'GoogleAppMeasurement' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'GoogleAppMeasurement' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseAnalytics' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseAnalytics' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'Pods-UnityFramework' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Unity-iPhone.xcodeproj: warning: The Copy Bundle Resources build phase contains this target's entitlements file '/Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Unity-iPhone/Unity-iPhone.entitlements'. (in target 'Unity-iPhone' from project 'Unity-iPhone') warning: Run script build phase 'Crashlytics Run Script' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Unity-iPhone' from project 'Unity-iPhone') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'Pods-Unity-iPhone' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'nanopb-nanopb_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'nanopb-nanopb_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'nanopb' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'nanopb' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'PromisesSwift-Promises_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'PromisesSwift-Promises_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'PromisesSwift' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'PromisesSwift' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'PromisesObjC-FBLPromises_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'PromisesObjC-FBLPromises_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'PromisesObjC' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'PromisesObjC' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'GoogleUtilities-GoogleUtilities_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'GoogleUtilities-GoogleUtilities_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'GoogleUtilities' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'GoogleUtilities' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'GoogleDataTransport-GoogleDataTransport_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'GoogleDataTransport-GoogleDataTransport_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'GoogleDataTransport' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'GoogleDataTransport' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseSessions' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseSessions' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseRemoteConfigInterop' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseRemoteConfigInterop' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseMessaging-FirebaseMessaging_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseMessaging-FirebaseMessaging_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseMessaging' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseMessaging' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseInstallations-FirebaseInstallations_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseInstallations-FirebaseInstallations_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseInstallations' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseInstallations' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseCrashlytics-FirebaseCrashlytics_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCrashlytics-FirebaseCrashlytics_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 11.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseCrashlytics' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCrashlytics' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseCoreInternal-FirebaseCoreInternal_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCoreInternal-FirebaseCoreInternal_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseCoreInternal' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCoreInternal' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseCoreExtension-FirebaseCoreExtension_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCoreExtension-FirebaseCoreExtension_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseCoreExtension' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCoreExtension' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseCore-FirebaseCore_Privacy' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCore-FirebaseCore_Privacy' from project 'Pods') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 18.4.99. (in target 'FirebaseCore' from project 'Pods') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'FirebaseCore' from project 'Pods') warning: UnityFramework isn't code signed but requires entitlements. It is not possible to add entitlements to a binary without signing it. (in target 'UnityFramework' from project 'Unity-iPhone') note: Disabling previews because SWIFT_VERSION is set and SWIFT_OPTIMIZATION_LEVEL=-O, expected -Onone (in target 'UnityFramework' from project 'Unity-iPhone') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Unity-iPhone.xcodeproj: warning: tasks in 'Copy Headers' are delayed by unsandboxed script phases; set ENABLE_USER_SCRIPT_SANDBOXING=YES to enable sandboxing (in target 'UnityFramework' from project 'Unity-iPhone') /Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Unity-iPhone.xcodeproj: warning: The Copy Bundle Resources build phase contains this target's entitlements file '/Users/jenkinsworkspace/workspace/_trunk_2/BuildOutput/xcodeBuild/Unity-iPhone/Unity-iPhone.entitlements'. (in target 'UnityFramework' from project 'Unity-iPhone') warning: Run script build phase 'Crashlytics Run Script' will be run during every build because it does not specify any outputs. To address this issue, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'UnityFramework' from project 'Unity-iPhone') ** ARCHIVE FAILED ** The following build commands failed: CodeSign /Users/bilibili/Library/Developer/Xcode/DerivedData/Unity-iPhone-gcghvbgmwprbskejwnbonhyizpju/Build/Intermediates.noindex/ArchiveIntermediates/Unity-iPhone/InstallationBuildProductsLocation/Applications/ProductName.app/Frameworks/UltraGlobalSDK.framework (in target 'Unity-iPhone' from project 'Unity-iPhone') Archiving workspace Unity-iPhone with scheme Unity-iPhone 什么问题
最新发布
10-25
<think> 我们正在处理一个Xcode编译报错:library not found for -lGameAssembly。结合用户提供的引用信息,我们可以总结出几种可能的解决方向: 1. 文件确实缺失或路径错误(类似引用[1][3]的情况) 2. 架构设置问题,特别是Xcode升级后架构变化(引用[2]) 3. 第三方配置问题(引用[4][5]) 由于错误中的名为GameAssembly,这可能是Unity项目生成Xcode工程后的一个(常见于Unity导出的iOS项目)。因此,我们可以按照以下步骤解决: 步骤1:确认文件是否存在 - 在Xcode项目中,检查libGameAssembly.a(或类似)是否存在于项目目录中(通常位于Libraries目录)。 - 检查Build Phases -> Link Binary With Libraries中是否存在该,如果存在但显示红色,则说明路径错误或文件缺失。 步骤2:添加文件路径 - 如果文件存在,检查Build Settings -> Library Search Paths(LIBRARY_SEARCH_PATHS)是否包含该所在的路径。 - 可以添加一个相对路径,例如:$(PROJECT_DIR)/Libraries (假设Libraries文件夹下) 步骤3:检查架构设置 - 根据引用[2],Xcode12之后模拟器使用arm架构编译,而老项目可能还依赖x86_64。因此,检查Build Settings -> VALID_ARCHS,确保包含x86_64(针对模拟器)和arm64(针对真机)。 - 另外,检查Build Active Architecture Only设置,在Debug模式下可以设置为NO(确保所有架构都编译),但Release应设置为YES(以减少包大小)。 步骤4:检查是否因为Xcode版本升级导致被移除(类似于libstdc++的问题) - 引用[1][3][5]提到Xcode10以上移除了libstdc++,但我们的错误是-lGameAssembly,所以不是同一个。因此,排除这个原因。 步骤5:如果是通过CocoaPods引入,检查Pod配置 - 引用[5]提供了一种通过修改Podfile来替换名的方法,但我们的是GameAssembly,通常不是通过CocoaPods引入的,因此这一步骤可能不适用。但如果GameAssembly是某个Pod依赖的,那么可能需要检查该Pod的配置。 步骤6:清理和重新生成 - 清理项目(Product -> Clean Build Folder),然后重新编译。 - 重新生成Unity导出的Xcode项目(如果是Unity项目,有时候重新导出可以解决)。 根据以上步骤,我们给出以下具体解决方案: 解决方案1:确认文件并设置搜索路径 1. 在Finder中定位到你的Xcode项目目录,检查是否存在libGameAssembly.a(或libGameAssembly.tbd等)。 2. 在Xcode中,将文件拖入项目中(如果尚未添加),确保勾选“Copy items if needed”和你的target。 3. 如果已经在项目中,但链接时找不到,可能是搜索路径不对。在Build Settings中搜索“Library Search Paths”,添加所在的路径(例如:$(PROJECT_DIR)/Libraries)。 解决方案2:设置架构 1. 在Build Settings中,找到“Valid Architectures”(VALID_ARCHS),添加x86_64和arm64(如果缺少)。 2. 将“Build Active Architecture Only”设置为NO(Debug模式下),确保模拟器和真机架构都被支持。 解决方案3:重新生成Xcode项目(针对Unity项目) 如果是Unity导出的项目,尝试重新导出Xcode项目,并确保导出时没有错误。 解决方案4:检查依赖关系 如果GameAssembly是某个依赖所需的,确保该依赖被正确安装和配置。 由于具体项目结构可能不同,请根据实际情况调整。 相关问题: 1. 如何检查Xcode中的文件是否存在? 2. 如何设置Xcode的Library Search Paths? 3. Xcode中如何设置架构(ARCHS和VALID_ARCHS)? 4. Unity导出的Xcode项目常见问题有哪些? 5. 如何清理Xcode的构建缓存? </think> ### 解决Xcode编译报错 "library not found for -lGameAssembly" 的方法 根据引用信息和Xcode常见问题,以下是系统性的解决方案: --- #### 1. **确认文件存在性** [^1][^3] - 检查项目是否包含 `libGameAssembly.a`(或 `.tbd`)文件 - 在Finder中搜索 `GameAssembly`,确认文件路径: ```bash find ~/ProjectDir -name "*GameAssembly*" ``` - 若文件缺失,需重新添加文件或联系提供方 #### 2. **设置搜索路径** [^1][^3][^4] 在Xcode中配置: ```markdown Target → Build Settings → Library Search Paths ``` - 添加文件所在目录路径(例如:`$(PROJECT_DIR)/Libraries`) - 使用 `recursive` 模式(路径后加 `/ **`)增强搜索能力 #### 3. **架构兼容性修复** [^2][^4] ```markdown Target → Build Settings → Build Active Architecture Only ``` - **Debug模式**:设置为 `NO`(确保编译所有架构) - **Release模式**:保持 `YES`(优化包体积) ```markdown Target → Build Settings → VALID_ARCHS ``` - 添加 `x86_64`(模拟器)和 `arm64`(真机) #### 4. **链接阶段验证** [^1][^5] ```markdown Target → Build Phases → Link Binary With Libraries ``` - 确认 `libGameAssembly` 存在于列表中 - 若显示红色丢失状态,右键选择 `Locate File` 重新关联 #### 5. **清除构建缓存** [^2] ```terminal # 终端执行 rm -rf ~/Library/Developer/Xcode/DerivedData rm -rf Pods/ ; pod install ``` 在Xcode菜单: ```markdown Product → Clean Build Folder ``` #### 6. **针对Unity项目的特殊处理** [^3][^5] 如果是Unity导出的Xcode工程: - 检查 `UnityFramework` 模块是否包含 `GameAssembly` 依赖 - 在 `Podfile` 添加后编译指令(模仿引用[5]): ```ruby post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['LIBRARY_SEARCH_PATHS'] = [ "$(inherited)", "$(PROJECT_DIR)/Libraries" ] end end end ``` --- ### 关键检测流程图 ```mermaid graph TD A[报错 library not found for -lGameAssembly] --> B{文件是否存在} B -- 存在 --> C[检查Library Search Paths] B -- 不存在 --> D[重新添加文件] C --> E{路径配置正确} E -- 是 --> F[检查架构兼容性] E -- 否 --> G[修正搜索路径] F --> H{包含x86_64/arm64} H -- 是 --> I[清理构建缓存] H -- 否 --> J[添加缺失架构] I --> K[重新编译] ``` --- ###
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值