32

I am unable to run my app in simulator after having trouble with the provisioning profile. I'm doing swift coding in Xcode 6 - beta 4. This was fine before the trouble in the certificate's profile.

I have tried cleaning the build. Checked the command line to xCode6-beta4 for running. Checked the build deployment, set to 7.0 so swift won't complain for compatibility Fixed the error in provisioning.

Cœur
  • 32,421
  • 21
  • 173
  • 232
NFerocious
  • 3,034
  • 2
  • 15
  • 36
  • have you tried to create another project to see if the problem is in your project or your machine? Have you tried to delete the app from the simulator? – Patrick Bassut Aug 05 '14 at 04:21
  • I had the same problem when I added an extension and I it was complaining about the wrong compiler. So, I went to target > Build Setting > Build Options > Compiler for C/C++/Objective-C and set the default and that fixed the error. Hope this can help you – estemendoza Aug 05 '14 at 23:27
  • Oh, sorry for that @Patrick, I can't do that. it's running clean just after the issue with the provisioning, because I want to test it on iPhone, after that provisioning issue, I can't run my app in simulator. I appreaciate your answer tnx. – NFerocious Aug 12 '14 at 11:01
  • @estemendoza, hmm I've set the command line to xcode6-beta4 for compilation but that error still persist. btw thanks again. – NFerocious Aug 12 '14 at 11:02
  • possible duplicate of [An error was encountered while running (Domain = LaunchServicesError, Code = 0)](http://stackoverflow.com/questions/25632886/an-error-was-encountered-while-running-domain-launchserviceserror-code-0) – Jeremy Huddleston Sequoia Dec 04 '14 at 05:13

19 Answers19

62

I fixed it by resetting the simulator:

iOS Simulator > Reset Contents and Settings...

k20
  • 1,958
  • 1
  • 16
  • 23
60

This happens if your extension's bundle ID isn't prefixed with your app's bundle ID. For example if you app is com.mycompany.appname, your extension should be something like com.mycompany.appname.today.

Something else to note, if you're using Swift and are setting a principal class with NSExtensionPrincipalClass, you'll want to make sure your extension target sets "Defines Module" to "Yes" and make the value of NSExtensionPrincipalClass equal to "YourModuleName.YourClassName".

Sam Soffes
  • 14,138
  • 9
  • 68
  • 78
  • my module was set like this as default $(PRODUCT_MODULE_NAME).KeyboardViewController – NFerocious Aug 14 '14 at 08:04
  • I have fixed that launch service, thanks for giving me advice guys, now I can't create ipa build "error: Embedded binary is not signed with the same certificate as the parent app. Verify the embedded binary target's code sign settings match the parent app's. Embedded Binary Signing Certificate: iPhone Developer: *************** (D26THLM79L) Parent App Signing Certificate: iPhone Distribution: *********** (735XZCJQ6P) " any Idea why this happens even though I have cleared all? – NFerocious Aug 14 '14 at 08:24
  • Old answer but, also make sure you've got the certificates for signing the build. Can cause this error. If for example you were working on one machine that has all the certs and you start working on another that doesn't. Depends on the type of app and build. – AppHandwerker Dec 18 '14 at 11:12
  • 1
    Wow @sam-soffes thanks for pointing this «obvious» issue; just saved me from bumping my head against the wall – esttorhe Aug 19 '15 at 02:22
  • 5
    Is it normal for Apple stuff to have a lot of obscure rules? – Ian Warburton Oct 21 '15 at 20:41
  • 3
    No, my watch app is setup correctly. I ran it. It worked just perfect. Added a few lines. And I got this obscure error. Clean and rebuild fixed it. Try to run it again .. and the error again. WatchKit is horrible. – Leandros Nov 10 '15 at 15:49
14

It seems that there are multiple reasons for "domain = LaunchServicesError code = 0" error. I also encountered it, while I try to reinstall app on iOS8 simulator. I cannot reinstall but have to delete the old app first.

The problem was solved by:

  1. In Xcode, fill empty Version or Build field with appropriate value in your Target->General->Identity

  2. In Simulator, reset Content and settings...

After that, everything works fine.

hufeng03
  • 404
  • 5
  • 9
  • That works for me. I tried lots of the tips from other posts but only this work. I had the Build set earlier but I set it to empty later so I always had this error. – bubuxu Nov 09 '14 at 00:21
  • Setting the Build field to a non-empty value fix this for me. – iosdude Jun 27 '16 at 14:20
11

This also happens when you remove the default StoryBoard from template created project of a Today widget. To fix this, I added the NSExtensionPrincipalClass under NSExtension and pointed it to the class containing the Today Widget View Controller, which is by template default TodayViewController.

This looks like this in the Info.plist of the extension:

NSExtension NSExtensionPointIdentifier String com.apple.widget-extension NSExtensionPrincipalClass String TodayViewController

Dhiraj Gupta
  • 7,159
  • 4
  • 43
  • 50
  • 1
    Thanks! This fixed the issue for me. –  Sep 21 '14 at 13:59
  • +1, That was the hint that finally got me in the right direction. I switched from a branch of a project with widget to another branch that doesn't have a widget. For some reason the simulator worked at first with that widget-less branch but then stopped. The solution in my case was a simple "Clean" (as in Cmd-Shift-K). – DarkDust Nov 13 '14 at 15:17
9
  1. Product -> Clean

  2. iOS Simulator > Reset Contents and Settings

  3. Restart XCode

Alan Dong
  • 3,443
  • 32
  • 32
8

None of the above worked for me, however deleting the Derived Data fixed the issue.

To delete the Derived Data, go to Window > Projects, select the current project, and press the appropriate delete button.

rob
  • 3,849
  • 3
  • 28
  • 40
6

"Reset Content and Settings" from iOS Simutalor menu options and launching simulator after Quitting solved my issue.

Reset Content and Settings

Sauvik Dolui
  • 5,060
  • 3
  • 29
  • 38
5

The solution for me was not to embed a framework that hadn't been built as an embeddable framework.

mxcl
  • 24,446
  • 11
  • 91
  • 95
4

Found the cause of the problem for me.

I am using ShareKit via pods. This issue is related to the GooglePlus SDK which ShareKit uses and this has to be updated due to a policy change by Apple. http://googledevelopers.blogspot.com.br/2014/09/an-important-announcement-for-ios.html

So i replaced my pod "ShareKit" with:

pod "ShareKit/Twitter"

pod "ShareKit/Facebook"

pod "ShareKit/Pocket"

pod "ShareKit/Evernote"

Leaving out the GooglePlus sub project and the application has deployed and runs fine under 8.0 simulators now.

Hope this helps somebody else.

Paul Gee
  • 151
  • 1
  • 3
1

I have resolve this issue. thanks for the advices. :)

This issue always happens when you build your keyboard extension app with same identifier as your main bundle. like this.

If you have this "com.codemagnus.ExAppMain" in your main bundle, your extension should also have this identifier "com.codemagnus.ExAppMain" .. This will result in launch service error if you are going to run in simulator. But you can create a build. However, the issue I have found was annoying. This app can't be install in your device. :/

If you want to run in simulator. You should have this "com.codemagnus.ExAppMain.ExApp" in your extension keyboard where ExApp was you extension name. And your main bundle should be "com.codemagnus.ExAppMain".. This will run perfectly with the simulator. However will result in "Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier."

Embedded Binary Bundle Identifier: com.codemagnus.ExAppMain.ExApp Parent App Bundle Identifier: com.codemagnus.ExAppMain

I'm still thinking and looking for a solution to solve this issue for ipa build.

NFerocious
  • 3,034
  • 2
  • 15
  • 36
1

This drove me crazy. I checked everything suggested here, reinstalled Xcode, restarted my computer and nothing worked. After checking some previous commits, I found out the issue.

For context, I am working on a custom keyboard extension in Objective C. Adding a new custom keyboard extension target gives you a KeyboardViewController stub class with the "next keyboard" button. I changed the NSExtensionPrincipalClass value in the Info.plist of the extension to be a class name different from KeyboardViewController and started work on it. Eventually I decided to get rid of the the stub KeyboardViewController since it was dead code.

Deleting the KeyboardViewController files and removing them from Xcode caused this problem to happen. Putting them back made the app work again.

Jared Egan
  • 1,268
  • 1
  • 12
  • 19
1

In my case, this has resolved the issue.

Bundle Identifier should not be empty. You can find the field with the below reference:

enter image description here

aToz
  • 2,429
  • 1
  • 22
  • 34
0

I got this error because I mistakenly changed the value of NSExtensionPointIdentifier. I thought it was supposed to be an ID for my extension, but it has to be one of these values indicating the kind of extension it is.

Tim Scott
  • 14,379
  • 9
  • 59
  • 75
0

I started getting this error when I changed my Deployment Target from 6.0 to 7.0. I found that resetting the simulator did solve the issue, and I needed to do this for ALL the simulators that were relevant to the app. But if I went back to 6.0 and recompiled for any particular simulator, then it worked immediately, but going again to 7.0 broke the simulator and I had to clear the settings again.

Obviously the Deployment Target affects the coding in the simulator, and the coding is downward compatible, but not upward. Plus, the log message isn't extremely helpful, saying the app couldn't be hardlinked to a cache file using a manifest (giving the pathnames to the app, cache, and manifest, of course).

user6026720
  • 514
  • 5
  • 3
0

Make sure you check build settings; scroll down to the very bottom and make sure your User-Defined Bundle prefix is correct. Usually com.whatever.

Just setting it at the top doesn't always change this bottom setting. This finally worked for me after resetting simulator, frying the derived folder, etc.

I'm under IOS 9.3, xCode 7.3

wm_j_ray
  • 144
  • 7
0

Xcode 7.3

This could simply happened because your target name is too long. Try change your target name to something shorter ( remember to change your bundleIdentifier to match ).

0

If you are using apple watch besides the bundle identifier you also have to make sure that in info.plist the key WKAppBundleIdentifier contains the right watch app bundle identifier.

Fahim
  • 1,281
  • 12
  • 27
0

I was getting the similar error while launching the app, thru xCode, "The parent bundle has the same identifier as sub-bundle..."

I shortened the Bundle Identifier in the "Project -> General" for xCode8. Initially, my bundle id was com.companyname..

The application name was more than 20 characters. Once I shortened it 12 characters, it worked for me.

NinjaAPW
  • 1
  • 1
0

To understand what is causing this error you need to go look at the simulator log files first. These are typically located in ~/Library/Logs/CoreSimulator/CoreSimulator.log or a similar location. So I'd strongly recommend you first look at the log to idenify the root cause and then research that further. (You can take a look at this thread to see where logs are located.)

For example if you get an error such as ErrorDescription=Failed to chmod /Users/username/Library/Developer/CoreSimulator/Devices/then it's probably easiest to reset your simulator. For errors such as ErrorDescription=WatchKit 2 app's bundle ID com.mydomain.AppName.watchapp is not prefixed by the parent app's bundle then there is probably an error with how you have set up the main bundle ID of your project.

carnun
  • 140
  • 11