unity打包到Xcode,从MAC中编译到手机报错

0 投票
最新提问 12月 27, 2020 用户: aN3IRwTcH5ipTHz (150 分)

完全按照文档设置,导入Framework,设置bitcode为no,但打包仍然报错,报错标题为linker command failed with exit code 1(use -v to see invocation)

整体错误信息提示如下

Ld /Users/macbook/Library/Developer/Xcode/DerivedData/Unity-iPhone-ewgjmowlyvutsycwyznwuglrngrt/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/UnityFramework normal arm64
    cd /Users/macbook/Desktop/ShuiWuAr_ios_easyAR9M
    export IPHONEOS_DEPLOYMENT_TARGET=11.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 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -L/Users/macbook/Library/Developer/Xcode/DerivedData/Unity-iPhone-ewgjmowlyvutsycwyznwuglrngrt/Build/Products/ReleaseForRunning-iphoneos -L/Users/macbook/Desktop/ShuiWuAr_ios_easyAR9M/Libraries -F/Users/macbook/Library/Developer/Xcode/DerivedData/Unity-iPhone-ewgjmowlyvutsycwyznwuglrngrt/Build/Products/ReleaseForRunning-iphoneos -F/Users/macbook/Desktop/ShuiWuAr_ios_easyAR9M/Frameworks/Plugins/iOS -filelist /Users/macbook/Library/Developer/Xcode/DerivedData/Unity-iPhone-ewgjmowlyvutsycwyznwuglrngrt/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework.LinkFileList -install_name @rpath/UnityFramework.framework/UnityFramework -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -map -Xlinker /Users/macbook/Library/Developer/Xcode/DerivedData/Unity-iPhone-ewgjmowlyvutsycwyznwuglrngrt/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/UnityFramework-LinkMap-normal-arm64.txt -miphoneos-version-min=11.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/macbook/Library/Developer/Xcode/DerivedData/Unity-iPhone-ewgjmowlyvutsycwyznwuglrngrt/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_lto.o -fembed-bitcode-marker -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -weak_framework CoreMotion -weak-lSystem -ObjC -framework CoreTelephony -liPhone-lib -framework Security -framework MediaToolbox -framework CoreText -framework AudioToolbox -weak_framework AVFoundation -framework AVKit -framework CFNetwork -framework CoreGraphics -framework CoreMedia -weak_framework CoreMotion -framework CoreVideo -framework Foundation -framework OpenAL -framework OpenGLES -framework QuartzCore -framework SystemConfiguration -framework UIKit -liconv.2 -lil2cpp -framework easyar -framework ARKit -weak_framework Metal -weak_framework GameController -Xlinker -dependency_info -Xlinker /Users/macbook/Library/Developer/Xcode/DerivedData/Unity-iPhone-ewgjmowlyvutsycwyznwuglrngrt/Build/Intermediates.noindex/Unity-iPhone.build/ReleaseForRunning-iphoneos/UnityFramework.build/Objects-normal/arm64/UnityFramework_dependency_info.dat -o /Users/macbook/Library/Developer/Xcode/DerivedData/Unity-iPhone-ewgjmowlyvutsycwyznwuglrngrt/Build/Products/ReleaseForRunning-iphoneos/UnityFramework.framework/UnityFramework

ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Users/macbook/Desktop/ShuiWuAr_ios_easyAR9M/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
ld: '/Users/macbook/Desktop/ShuiWuAr_ios_easyAR9M/Frameworks/Plugins/iOS/easyar.framework/easyar' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/macbook/Desktop/ShuiWuAr_ios_easyAR9M/Frameworks/Plugins/iOS/easyar.framework/easyar' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

1个回答

0 投票
最新回答 2月 9, 2021 用户: kenn (19,220 分)
见错误信息最后几行:

ld: '/Users/macbook/Desktop/ShuiWuAr_ios_easyAR9M/Frameworks/Plugins/iOS/easyar.framework/easyar' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/macbook/Desktop/ShuiWuAr_ios_easyAR9M/Frameworks/Plugins/iOS/easyar.framework/easyar' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

请注意:Unity生成的工程中有很多工程,而不同unity版本生成的工程有差别,请仔细检查并关闭所有工程的bitcode,关闭PROJECT的bitcodce。
欢迎来到 EasyAR Q&A ,有什么不懂的可以尽管在这里提问,你将会收到社区其他成员的回答。
...