Apple Watchkit simulator issue: SPErrorInvalidBund

2019-01-18 18:02发布

When I open my existing Watchkit app (Xcode 6.2), it compiles correctly, the simulators are launched (iPhone+Watch), followed by the meaningful error:

Error Launching 'xxx Watchkit Extension' SPErrorInValidBundleNoGizmoBinaryMessage

I have this issue with all simulators (iPhone 5/5S/6/6+ - 38mm/42mm)

Any ideas what the issue can be?

It seems for some reason the application does not want to run on the simulator, even though it used to. The iPhone application included in the same project does run, as do other Watchkit sample applications.

9条回答
祖国的老花朵
2楼-- · 2019-01-18 18:16

Be sure you are using an 8.3 simulator.

I got this message consistently when using 8.2. Tried everything listed here and struggled with this for hours. Switching to 8.3 resolved it. Ironic, since you must set the deployment target to 8.2 at the moment, but watchkit apps need 8.3 to run I guess...

查看更多
老娘就宠你
3楼-- · 2019-01-18 18:16

For issues on real devices (not simulator), do everything in this post: http://blog.jaredsinclair.com/post/117350678170/jareds-code-signing-tips-apple-watch-edition

Most importantly:

All three targets require the following:

a unique app ID for that target a code signing identity (applies to all targets) a unique provisioning profile for that target.

and make sure that the app ID's are consistent:

Your app IDs will look something like this:

com.company.App-Name

com.company.App-Name.todaywidget

com.company.App-Name.watchkitapp

com.company.App-Name.watchkitextension

If it still doesn't work, manually delete the app from the watch (by holding onto the icon and then hit 'x') and then try again. This was the kicker that did it for me.

查看更多
Viruses.
4楼-- · 2019-01-18 18:18

WKAppBundleIdentifier may need to be same to WatchKit App's Bundle Identifier.

Please check WatchKit Extension's info.plist. NSExtension - NSExtensionAttributes - WKAppBundleIdentifier - xxxxx.watchkitapp

EDIT: Further explanation to clarify...

Under your App target you go to INFO tab and set Bundle Identifier to com.myapp

Then under the WatchKit Extension target you go to INFO tab and set the Bundle Identifier to com.myapp.watchkitextension

Then still under the WatchKit Extension target and still under the INFO tab you set NSExtension > NSExtensionAttributes > WKAppBundleIdentifier to com.myapp.watchkitapp

So one ends with .watchkitextension and the other ends with .watchkitapp

查看更多
闹够了就滚
5楼-- · 2019-01-18 18:19

I've been struggling with this as well. This is what solved my problem on Xcode 7.1 iOS 9. Just Make sure you follow the naming below for your identifiers:

  • Target - com.myCompany.myApp
  • Watchkit app - com.myCompany.myApp.watchkitApp
  • Watchkit extension - com.myCompany.myApp.watchkitApp.watchkitextension

The extension should have the identifier of the WatchKit app target + .watchkitextension

查看更多
\"骚年 ilove
6楼-- · 2019-01-18 18:23

Check Info.plist for "Your App WatchKit Extension" & "Your App WatchKit App". First part of all indentifiers should be same.

In my case problem was in "Your App WatchKit Extension" > NSExtension > NSExtensionAttributes > WKAppBundleIdentifier.

My problem was in this string

查看更多
疯言疯语
7楼-- · 2019-01-18 18:27

The procedure I solved the problem is

  1. Check if WKAppBundleIdentifier and bundle identifier in WatchKit extension and WatchKit App are correct
  2. Delete subfolders of ~/Library/Developer/CoreSimulator/Devices
  3. Delete subfolders of ~/Library/Developer/Xcode/DerivedData
  4. Clean my project
  5. Restart simulator
  6. Run
查看更多
登录 后发表回答