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

后端 未结 25 1111
天涯浪人
天涯浪人 2020-12-01 00:39

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 everythi

相关标签:
25条回答
  • 2020-12-01 01:07

    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.

    0 讨论(0)
  • 2020-12-01 01:08

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

    0 讨论(0)
  • 2020-12-01 01:09

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

    0 讨论(0)
  • 2020-12-01 01:10

    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

    0 讨论(0)
  • 2020-12-01 01:10

    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.

    0 讨论(0)
  • 2020-12-01 01:11

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

    0 讨论(0)
提交回复
热议问题