Unable to run app in Simulator: An error was encountered while running (Domain = LaunchServicesError, Code = 0)

IosObjective CXcode6

Ios Problem Overview


After successfully compiling the project in Xcode 6, I am unable to run it in the simulator with the above mentioned message. I did all the possible research, tried everything and still no advances.

I am not working with swift, neither I use widgets or extensions, so please do not suggest solutions caused by these as can be seen in similar questions.

If someone found a possible cause (or solution!!) other than these, please help. Thanks

Ios Solutions


Solution 1 - Ios

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

Reset Content and Settings

Solution 2 - Ios

Cleaning the build folder resolved the issue for me. I hope it helps someone!

(While holding down the Alt-key: Product > Clean build folder)

Solution 3 - Ios

I tried every other solution listed here. Well, I ported my project from Swift 1.2 to Swift 2.0. The application was stuck even after a lot debugging and launch services error 0 was reported.

solution: It happens because of framework compilation.

App target -> Build Phases -> Embed Frameworks.

So mark copy only when installing on. Clean the project and run it!

enter image description here

Solution 4 - Ios

This has now been resolved. The problem was caused by ShareKit library added by CocoaPods for compatibility reasons. After removing the library and all related code, the app successfully launched in simulator. I recommend checking the system log for more details on the issue as to me it pointed me in the right direction (stating the name of conflicting library).

Solution 5 - Ios

In case anyone has this problem in combination with cocoa pods, these steps helped me to solve this error (after few hours):

  • run pod cache clean
  • from SRC_ROOT run rm -rf Pods (optionally rm Podfile.lock)
  • Click on the Simulator app, click Simulator -> Reset Content and Settings...
  • Go into Xcode, In the Menu bar click Product -> Clean (or click Shift + Command + K).This will to clean your Xcode project.
  • Create a new Terminal Shell (From menu bar click Shell -> New Window)
  • run rm -rf ~/Library/Developer/Xcode/DerivedData/

...then try to Build & Run your project.

Note: SRC_ROOT can be found by entering the Navigator, clicking on the project, clicking on the project again from the project and targets list, going into Build Settings, scrolling all the way to the bottom to the User-Defined Section, and the SRC_ROOT will be labeled as PODS_ROOT. Take that and copy it verbatum into the Terminal and proceed with step 2 from the list above.

Hope it helps.

Solution 6 - Ios

I get rid from the issue by the given steps for simulator

1. Way

  1. Reset Content and Settings of Simulator.
  2. Clean your project by Cmd+Shift+K.
  3. Clear your Derived Data.
  4. The last one which is more important change your Bundle Identifier by "com.yourcompanyname.projectname" like "com.facebook.Facebook"

2. Way

You can do only be the given line, it works for me

The last one which is more important change your Bundle Identifier by "com.yourcompanyname.projectname" like "com.facebook.Facebook"

Thanks and enjoy programming.

Solution 7 - Ios

Might be related to this issue: https://stackoverflow.com/questions/28007290/this-app-contains-an-app-extension-with-an-illegal-bundle-identifier-issue/31101836#31101836

I had to format the bundle identifiers for my app and extension as follows:

com.company.AppName
com.company.AppName.Extension

Solution 8 - Ios

  1. First "Reset Content and Settings"
  2. If you didn't fill the build number and fill it and Run.

It's solved for me.

Solution 9 - Ios

If you change the name of the supplied class InterfaceController set by default when you start a new project. This class is referenced in the Info.plist under the key RemoteInterfacePrincipalClass. In my case, I got the error mentioned by the OP until I fixed the name of the class in there (see screenshot).

Info.plist: set principal class

Solution 10 - Ios

Thanks for pointing this out @Miki and kudos to you. I had the same issue as you yesterday (and I added ShareKit 3.0.0 from CocoaPods to the app a few days ago). I suspected ShareKit giving me this problem, but now I can be confident of exactly which library is causing this. Here is what I found in my log (if it can benefit others):

> Error Domain=LaunchServicesError Code=0 "The operation couldn’t be > completed. (LaunchServicesError error 0.)" UserInfo=0x7fa836097aa0 > {Error=PackageInspectionFailed, ErrorDescription=Failed to load > Info.plist from bundle at path > /Users/{UserName}/Library/Developer/CoreSimulator/Devices/99FEB34E-6F00-4EFA-861A-A6985AFE96D8/data/Library/Caches/com.apple.mobile.installd.staging/temp.X7eead/extracted/{AppName}.app/Frameworks/LiveSDK.framework}

Solution 11 - Ios

If you are here after having issues doing an integration with WatchOS 2.0, go to - ~/Library/Logs/CoreSimulator/[Device UDID]/system.log and if says something like WatchKit 2 app has frameworks; that's not allowed. then follow the link below.

http://zyafa.me/blog/watchos-2-and-embedded-frameworks

Solution 12 - Ios

I'm adMob user and I solved enabling "Copy only when installing" in App target -> Build Phases -> Embed Frameworks.

Solution 13 - Ios

Have the same problem after localizing my app. Especially Info.plist. Seems I had empty CFBundleShortVersionString in InfoPlist.strings, after fixing that the simulator started to work properly.

Solution 14 - Ios

I got this issue by adding a folder reference named "Resources".

If I give it another name, then it runs !

Solution 15 - Ios

There are a number of things that can cause this error. The best general answer is to search the console log for CoreSimulator, as the simulator logs the underlying problem when it displays this message.

Solution 16 - Ios

If you have installed any libraries using CocoaPods while XCode was open, all you have to do is, Close XCode and remove the library from Pod file, run the command pod install it will uninstall that library. then install library again. Please make sure that XCode is always closed while installing and uninstalling libraries.

Solution 17 - Ios

I hade exactly the same problem and it was ShareKit.

On the simulator I had "Error Domain=LaunchServicesError Code=0".

On the iPhone6 device I had "App installation failed Could not inspect the application package."

When I removed ShareKit it worked.

Solution 18 - Ios

I had this problem when I added an Apple Watch target to my app, and accidentally removed the InterfaceController.m file. Adding back the file in the target fixed the problem.

Solution 19 - Ios

There are different things that can cause this. Looking in the console may well give you a clue.

In my case - the issue was an extension built before I changed the name of the product. Xcode didn't clear the old one out, then got stressed at two extensions with the same bundle id.

(Deleting the build folder fixed my particular issue).

Solution 20 - Ios

In my case the issue came from an icon set added with some images missing. Once I replaced the icon set with another one, and uninstalled the app in the simulator; I was able to run it again.

Solution 21 - Ios

I removed all my pod files and replaced them all, seems the problem for me was the bolts framework was old, and causing this error. I did a clean & reset content and now it's all good.

Solution 22 - Ios

Do not add the google maps framework to the embedded lib section this solved my build break.

Solution 23 - Ios

I had this error in developing app for Apple Watch after adding in Info.plist: "App Transport Security Settings" and "Allow Arbitry Loads" = YES. (In WatchKit App, in WatchKit Extension is good!!) Deleting this two rows, it keeps working.

enter image description here

Solution 24 - Ios

For me, the problem occurs because I added my framework (GoogleMobileAds.framework in my case) to Embedded Binaries, not Linked Frameworks and Libraries.

For your information, AdMob instructs you to use Add Files to "Your Project" menu on Xcode, but I was too lazy to obey the instruction.

Solution 25 - Ios

I had this problem when trying to run UI tests in a project containing AWS Cognito.

Here's how I resolved it.

  1. Select the UI test target.
  2. Click on the Build Phases section.
  3. Click the plus to add a Copy Files phase Add Copy Files phase
  4. In the Copy Files phase, change the destination to Frameworks (see the last image)
  5. Hit the plus below the Copy Files phase.
  6. Select the framework for which you're receiving an error and hit the Add button (yours will probably not be the first item in your project hierarchy). Select Framework to copy It should end up looking like this. Final Result
  7. Repeat steps 5 and 6 for all frameworks giving you an error.
  8. Run your tests.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMikiView Question on Stackoverflow
Solution 1 - IosSauvik DoluiView Answer on Stackoverflow
Solution 2 - IosHannes LohmanderView Answer on Stackoverflow
Solution 3 - IosAlvin GeorgeView Answer on Stackoverflow
Solution 4 - IosMikiView Answer on Stackoverflow
Solution 5 - IosJakubKnejzlikView Answer on Stackoverflow
Solution 6 - IosDharmbir SinghView Answer on Stackoverflow
Solution 7 - IosAzin MehrnooshView Answer on Stackoverflow
Solution 8 - IosChathurkaView Answer on Stackoverflow
Solution 9 - IoscharlesView Answer on Stackoverflow
Solution 10 - IosappdogView Answer on Stackoverflow
Solution 11 - IosinsanoidView Answer on Stackoverflow
Solution 12 - IosMatte.CarView Answer on Stackoverflow
Solution 13 - IosMuHAOSView Answer on Stackoverflow
Solution 14 - IosMooseView Answer on Stackoverflow
Solution 15 - IosChristopher PickslayView Answer on Stackoverflow
Solution 16 - IosAtif FarrukhView Answer on Stackoverflow
Solution 17 - IosAdinpView Answer on Stackoverflow
Solution 18 - IosspybartView Answer on Stackoverflow
Solution 19 - IosConfused VorlonView Answer on Stackoverflow
Solution 20 - IosiyepesView Answer on Stackoverflow
Solution 21 - IosReduxDJView Answer on Stackoverflow
Solution 22 - IosRavi DalmiaView Answer on Stackoverflow
Solution 23 - IosAlessandro MattiuzziView Answer on Stackoverflow
Solution 24 - IosBlaszardView Answer on Stackoverflow
Solution 25 - IosRich AquinoView Answer on Stackoverflow