iOS-arm64 but attempting to link with file built for unknown-unsupported file

记一次iOS上踩到的坑,替换修复bug后的sdk后无法编译通过,最后发现是没有使用git lfs pull的锅。
1
2
Undefined symbols for architecture arm64:
file built for unknown-unsupported file format (0x56 0x65 0x72 0x73 0x69 0x6F 0x6E 0x73 0x2F 0x43 0x75 0x72 0x72 0x65 0x6E 0x74)
1
2
3
4
5
6
7
8
9
ld: warning: ignoring file /Volumes/Data/c1/ios/ios_xmjz/HLSDK/AppsFlyerLib.framework/AppsFlyerLib, building for iOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x56 0x65 0x72 0x73 0x69 0x6F 0x6E 0x73 0x2F 0x43 0x75 0x72 0x72 0x65 0x6E 0x74 )
ld: warning: arm64 function not 4-byte aligned: _unwind_tester from /Volumes/Data/c1/ios/ios_xmjz/Libraries/libiPhone-lib.a(unwind_test_arm64.o)
ld: warning: Could not find or use auto-linked framework 'FBLPromises'
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_AppsFlyerLib", referenced from:
objc-class-ref in HLSDKFramework(HLAppsFlyerTracker.o)
objc-class-ref in HLSDKFramework(HLGameService.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

通过对比md5发现,文件发生了变化,替换正常文件即可!

一般情况是使用了git lfs,但拉取时没有使用git lfs pull。

1
2
3
4
5
6
7
# 报错的库 md5
$ md5 AppsFlyerLib.framework/AppsFlyerLib
MD5 (AppsFlyerLib.framework/AppsFlyerLib) = 81ee2da297f93f84336c607e388903f9

# 正常的库 md5
$ md5 AppsFlyerLib.framework/AppsFlyerLib
MD5 (AppsFlyerLib.framework/AppsFlyerLib) = 029b7caa1b69ffcd20b9807d98a07afb
------ 本文结束------