4

I'm working on a project that has four targets: an iOS and Mac framework, and an iOS and Mac example application target. The frameworks have identical code, and the example apps are very nearly using the same code (it's a SwiftUI app). I've done this sort of thing before, but now, while my Mac app and Mac framework happily co-exist and work fine, the iOS framework simply can't be found in the iOS example app.

Error message showing my framework not being found

Hoo boy, have I tried everything I can think of.

  • Yes, the framework is present in the example app's "Frameworks, Libraries..." section under General, and also appears in the Build Phases "Dependencies" as well as "Link Binary with Libraries" sections.
  • I've tried various values for the Framework Search Paths in Build Settings, though the Mac one has no value for that field and it's fine.
  • Ditto for Runpath Search Paths. On the Mac it's "@executable_path/../Frameworks", and I've tried that and various others on the iOS side.
  • The framework builds just fine by itself. I can look at it in Derived Data, and it seems to be there and present. Here's a capture of that folder.

iOS Framework files in Derived Data

I'm not sure what else to try at this point. I don't know if this is a bug in Xcode 12 Beta, perhaps? Or in Big Sur Beta? Is there anything else I can look at to figure out what's going on?

Aaron Vegh
  • 5,217
  • 7
  • 48
  • 75
  • Not sure, but, can architecture be a problem here? How are you building the framework? I mean, for which platform? – Fahri Azimov Aug 13 '20 at 00:12
  • The iOS framework is being built for arm using the standard architectures... – Aaron Vegh Aug 13 '20 at 00:32
  • I created Test project, seems fine to me. Do you have same structure as I am using? https://github.com/k-thorat/SO-63385668 – k-thorat Aug 13 '20 at 01:01
  • Yeah, this looks like my project setup. But there's no code in your app at all! LOL Agreed that yours compiles, so I guess we can rule out something fundamentally wrong with Xcode 12 Beta... – Aaron Vegh Aug 13 '20 at 02:20
  • Here's a clue: I created a new iOS project, then in the original project with all the targets, I built the iOS framework. Then I dragged that framework into the new project, and it works! It seems that when the framework is built as a dependency, the build products are incomplete. Any idea why? – Aaron Vegh Aug 13 '20 at 02:46
  • 1
    Tried on beta 6, still the issue persists. @AaronVegh - Did you find out any solution? Been breaking my head on this. TIA. – SMP Sep 10 '20 at 02:36
  • You can try the top answer of this ask. [link here](https://stackoverflow.com/questions/65978359/xcode-error-building-for-ios-simulator-but-linking-in-dylib-built-for-ios-f) – Bomi Chen May 11 '21 at 07:57

0 Answers0