I have a Cocoa Touch Framework that I developed for using in both my iOS app and my WatchKit app on iOS 8. I have no problems with iOS 8, however when I move the project to iOS 9 and update the WatchKit app to run natively I get the following error:
ParkFinderKit was rejected as an implicit dependency for 'ParkFinderKit.framework' because it doesn't contain platform 'watchsimulator' in its SUPPORTED_PLATFORMS 'iphonesimulator, iphoneos'
I attempted to manually add watchossimulator and watchos to the list of supported platforms:
However this produces another error:
ParkFinderKit was rejected as an implicit dependency for 'ParkFinderKit.framework' because its SDK is platform 'com.apple.platform.iphonesimulator' and it needs to match platform 'com.apple.platform.watchsimulator'
Any ideas as to how to solve my issue?
Cocoa and Cocoa Touch are the application development environments for OS X and iOS, respectively. Both Cocoa and Cocoa Touch include the Objective-C runtime and two core frameworks: Cocoa, which includes the Foundation and AppKit frameworks, is used for developing applications that run on OS X.
To build a watch-only app, start a new project in Xcode, select the Watch App template, and click Next. Provide a name, and choose the interface, life cycle, and language for your watch app. Select the options to include a notification scene template or unit and user interface tests, and click Next.
Okay, it looks like you cannot use a Cocoa Touch Framework inside of a WatchKit app. I was able to get around this by creating a new Watch Framework target and then assigning each file from the original framework to the new framework in the Target Membership options.
This accomplishes my goal of sharing code between iOS and WatchKit without having duplicate code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With