4

Info

My app is crashing on Apple Watches running watchOS 4 & 5. Some new features (ie Combine), depend on watchOS 6, and the use of these methods are explicitly marked with

@available(watchOSApplicationExtension 6.0.0, *)

The application was created with Xcode 9/10 (I forget exactly which), and targets watchOS 4. Now when it's built with Xcode 11, and has files which depend on Combine, it crashes on a watchOS 5 Apple Watch.

The error is

dyld: Library not loaded: /System/Library/Frameworks/Combine.framework/Combine
  Referenced from: /private/var/containers/Bundle/Application/7A361FAB-EBE7-483D-BFD7-E915F15B5B14/Chirp WatchKit App.app/PlugIns/Chirp WatchKit Extension.appex/Chirp WatchKit Extension
  Reason: image not found

Clearly, Combine, isn't playing nicely.

Also, it will not launch in a watchOS 5 simulator, and the error is slightly more telling:

dyld: Library not loaded: /System/Library/Frameworks/Combine.framework/Combine
  Referenced from: /Users/willbishop/Library/Developer/CoreSimulator/Devices/C6F36860-E70A-45E6-AC3B-E54DBCEA7C7A/data/Containers/Bundle/Application/1B2EC7C4-731F-4EC1-B23F-09A0B49CD055/Chirp WatchKit App.app/PlugIns/Chirp WatchKit Extension.appex/Chirp WatchKit Extension
  Reason: no suitable image found.  Did find:
    /System/Library/Frameworks/Combine.framework/Combine: mach-o, but wrong architecture

What I've Tried:

  • I thought it may be as I had watchOS 6 dependent code, mixed alongside watchOS 5 files. However, after moving the code into seperate files, the issue persists.

  • Cleaning the project

  • Removing Derived Data/

Despite that, no luck. I assume it's a build setting somewhere, but I wouldn't have the faintest clue of which one.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Will
  • 4,942
  • 2
  • 22
  • 47

1 Answers1

1

I believe what you need to do is make the Combine.framework optionally linked. For some reason, Combine can't use the normal UI for this (yet?), but it seems there is a solution in another thread.

nheagy
  • 363
  • 2
  • 6