Tom Shen
Tom Shen

Reputation: 2028

Can not launch app after adding watchOS version

I am making a watchOS version of my app, I make through the iPhone part with no problem. When I just added the watchOS part, I can't launch the app. This is the error:

The operation couldn’t be completed. (LaunchServicesError error 0.)

I tried cleaning the build folder, resetting the simulator, and changing the build version, even restarting both Xcode and simulator. Neither of these ways works. But when I deleted the watchOS version of my app, it starts to launch without problem.

Now how can I launch the app in the simulator without deleting the watchOS version?

P.S. After adding the watchOS version, the iPhone version does not launch as well with the same error.

Upvotes: 3

Views: 224

Answers (4)

Harish
Harish

Reputation: 1408

Please note that if the solution below doesn't work try this: If all else fails if you go into the Console (just search "Console" in spotlight) and go to the system.log, and if you follow the advice in the system.log it should lead you to your error :).

I just experienced this problem now, and after a bit of trying to figure out the issue I think I found a solution so you don't have to make a brand new Xcode Project. First, do what @Flipper said, which is to make sure the Bundle Identifier is the same in the Watch.plist with the watchkit.extension/app at the end. But also, there is an additional step. If you open up the navigator and select your project as shown in the picture below:enter image description here

After doing that change your target from the apps name with the little "A" paintbrush to your Watch App as shown in this picture: enter image description here

Make sure the bundle identifier matches the bundle identifier you set exactly with a .watchkitapp appended to the end. Like this:

enter image description here

Repeat this process, but this time change your target to the Watch Extension instead of the Watch App.

Upvotes: 0

Harish
Harish

Reputation: 1408

If nothing else works I would recommend creating a new Xcode Project (File -> New -> Project). Then navigate to the watchOS section and choose iOS app with WatchKit App. From there it is a matter of copying and pasting code from your old project to the new project.

There is more information about this here.

Upvotes: 0

Flipper
Flipper

Reputation: 1107

Have you checked your Bundle Identifier in Watch.plist? Bundle Identifier needs to be same as you iOS app with added to the end wachkit.extension/app

Upvotes: 1

salabaha
salabaha

Reputation: 2478

Make sure you iPhone app target and watch target have the same version and build numbers.

Upvotes: 1

Related Questions