Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Works on Simulator, fails on device: error: WatchKit App doesn't contain any WatchKit Extensions

I am seeing the following error when trying to run a project on a real device, in the simulator it runs fine.

error: WatchKit App doesn't contain any WatchKit Extensions. Verify that the value of NSExtensionPointIdentifier in your WatchKit Extension's Info.plist is set to com.apple.watchkit

Things which may or may not be relevant

  • I am using cocoa pods in both the watch and main app target
  • The project is mostly objective-c but has a few swift files
  • Xcode 8.1 (8B62)
  • Device Software Versions: iOS 10.1.1 & WatchOS 3.1
  • Deployment Info > Deployment Target: iOS 10.0 watchOS 3.0

Things I’ve tried

  • I have checked several times that all the correct files belong to the watch target. I may have missed something here, but I assume it wouldn’t run on the simulator if this was the case
  • Bundle identifiers
    • main app’s identifier: < app id >
    • watch app’s bundle identifier: < app id >.watchkit
    • watch app’s WKCompanionAppBundleIdentifier: < app id >
    • watch extension’s bundle identifier: < app id >.watchkit.extension
    • watch extension’s NSExtension>NSExtensionAttributes>WKAppBundleIdentifier: < app id >.watchkit
  • NSExtension>NSExtensionPointIdentifier: com.apple.watchkit
  • WKWatchKitApp is set to YES in both the Watch Extension and the Watch App
  • I have removed and re-added the .appex from Build Phases>Embed App Extensions
  • Ensuring Mach-O Type is set to executable in all targets
  • Re-installing pods as described in this answer
  • Clearing derived data
  • Clearing build folder
  • Restarting Xcode
  • I tried an archive and this failed with the same error

In lieu of an answer, advice on debugging / troubleshooting this would be appreciated too.

like image 904
lewis Avatar asked Nov 03 '16 06:11

lewis


1 Answers

I've seen this intermittently, but usually rebuilding a second time fixed it. I've never got to the bottom of why.

I've always assumed it's a bug in Xcode.

Sorry can't be more help, but you're not alone in seeing this.

like image 143
John Pollard Avatar answered Nov 09 '22 15:11

John Pollard