32
votes

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.

19
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
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 youestemendoza
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
@estemendoza, hmm I've set the command line to xcode6-beta4 for compilation but that error still persist. btw thanks again.NFerocious

19 Answers

62
votes

I fixed it by resetting the simulator:

iOS Simulator > Reset Contents and Settings...

60
votes

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".

14
votes

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.

11
votes

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

9
votes
  1. Product -> Clean

  2. iOS Simulator > Reset Contents and Settings

  3. Restart XCode

8
votes

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.

6
votes

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

Reset Content and Settings

5
votes

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

4
votes

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.

1
votes

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.

1
votes

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.

1
votes

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

0
votes

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.

0
votes

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).

0
votes

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

0
votes

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
votes

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.

0
votes

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.

0
votes

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.