2

Posting some learnings after much searching for:

  • Xcode app deploys fine in debug mode to iOS device, but archive fails with: symbol(s) not found for architecture arm64
  • Archiving an app with an internal framework
  • Using Swift in a framework with Objective-C

The situation: I was refactoring an iOS app and added an audio unit target. To share the main parts of the app I created a private framework. The refactor went well and the app deployed to the devices just fine. But archiving was failing, it seemed Xcode was stripping symbols out.

The "arm64" is a bit misleading. It's also not a strip on copy problem (see this post on a static library). Changing any of the settings did not work, e.g. removing symbols in the "Copy Phase Strip", "Remove Swift symbols". Builds would fail with the linking error:

Undefined symbols for architecture arm64:
  "_OBJC_CLASS_$__TtC13_SOMETHING_31_SomeOtherClassName", referenced from:
      objc-class-ref in SomeObjCFile.o
      ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Amy
  • 1,318
  • 3
  • 12
  • 24
  • Did you get answer to this? Facing exact same issue when I changed my frameworks from static to dynamic. – ImShrey Jul 03 '23 at 14:11

1 Answers1

0

Solution: add public to framework classes you want to expose to Obj-C.

It turns out release mode is stricter. Add public to framework classes and methods you want to expose to Objective-C. Also found a raywenderlich.com article, "Creating a Framework for iOS", that explains things.

Amy
  • 1,318
  • 3
  • 12
  • 24