0

I got the following warning on Github CI when trying to build an iOS archive:

ld: warning: ignoring file ios/myframework.xcframework/ios-arm64/myframework.framework/myframework, building for iOS-arm64 but attempting to link with file built for unknown-unsupported file format ( 0x76 0x65 0x72 0x73 0x69 0x6F 0x6E 0x20 0x68 0x74 0x74 0x70 0x73 0x3A 0x2F 0x2F )

then this error followed:

Undefined symbols for architecture arm64:

Now the confusing thing is that this error can happen because of several reasons, in my case, it was neither of any I could find online.

f4z3k4s
  • 966
  • 7
  • 13

1 Answers1

9

After hours of debugging I was able to figure out that the unknown-unsupported file format warning appeared because I was using Git LFS for the framework's binary. Git LFS replaces the binary with a text pointer. When Xcode was trying to build my archive on the CI, it didn't pull the binary from LFS, hence the string pointer remained at ios/myframework.xcframework/ios-arm64/myframework.framework/myframework. Make sure to pull your large binaries from LFS before trying to setup an Xcode build on the CI or you might see some not-so-easy-to-debug issues like this.

So the solution was actually as easy as running git lfs pull before trying to build the archive, and voilá, the error was gone.

f4z3k4s
  • 966
  • 7
  • 13
  • i'm trying with your solution, but still same issue. Could you please help me, i'm facing same issue. Please check the attached question. https://stackoverflow.com/questions/70972588/fastlane-mapbox-framework-architecture-arm64-symbol https://stackoverflow.com/questions/70942325/undefined-symbols-for-architecture-arm64-ios – Sham Dhiman Feb 06 '22 at 07:20
  • Answered in: https://stackoverflow.com/questions/70972588/fastlane-mapbox-framework-architecture-arm64-symbol/71034157#71034157 – f4z3k4s Feb 08 '22 at 12:45
  • Bingo, had to open my project in Sourcetree and it asked me to do exactly this. – swiftyboi Apr 29 '22 at 21:06
  • I actually ran into the same situation. Unbelieveable! It's so important to check all your preparation work in script including stuff like git-lfs! – Lebecca Aug 20 '22 at 11:30