FBSOpenApplicationErrorDomain error 1

22,598

Solution 1

I had the same error after updating Xcode to v7.0. After few hours struggling, I found that there was some empty environment variable setup to be passed for Run action in my active scheme (have no idea why it was there). Removing this empty environment variable resolved the issue immediately.

Solution 2

This error happens when a previous run of the app is still alive in the background, even if you clicked "Stop" in Xcode. Try manually killing the app in simulator itself: cmd+shift+H twice to open up running apps, drag up your app to kill it. Note cmd+shift+H is the shortcut to go to homescreen. Then start the new run and it should work fine :)

Solution 3

  1. Simulator->Reset Content and Settings
  2. Quit Simulator
  3. Run the test cases again

Solution 4

In a tvOS app, you can go to simulator and delete the app in there and then re-run the program.

Solution 5

If the other fixes don't work

Went through these attempts:

  1. Force quit the app in simulator
  2. reset simulator
  3. removed app from simulator
  4. Disabled App Transport Security globally (not recommended)
  5. Turned off all background modes issue always returned preventing debug sessions

This was my fix

Seems like the schemes manager enables a field with no arguments that caused my issue.

Product menu > Scheme > Edit Scheme > Run > Arguments > Environment Variables

If there is a checkmark there with an empty field next to it, then uncheck it.

I was getting the "1" error code. I hope this works for you too.

Share:
22,598
Douglas Ferreira
Author by

Douglas Ferreira

Lead iOS Developer @iFood and CocoaHeads Campinas Chapter-Leader

Updated on July 09, 2022

Comments

  • Douglas Ferreira
    Douglas Ferreira almost 2 years

    I'm trying to run my iOS app that was migrated from Swift 1.2 to Swift 2.0 in Xcode 7 using iPhone Simulator (any), I'm getting the following error:

    The operation couldn’t be completed. (FBSOpenApplicationErrorDomain error 1.)

    I already tried to reset simulator settings and content, quit Xcode, clean project, etc.

  • Ian Warburton
    Ian Warburton over 8 years
    Yes, the fixed it! I had a check box checked under Environment Variables but no names or values. How did you find that?
  • Denis
    Denis over 8 years
    as I said, few hours of struggling makes you looking in impossible places
  • bistekka
    bistekka over 8 years
    What makes you think this has anything to do with ATS or Facebook?
  • likid1412
    likid1412 over 8 years
    If "dismiss" means "shift + command + H" to let app into background, it solves my problem.
  • William Entriken
    William Entriken about 8 years
    I CREATED and then removed an environmental variable. It fixed it.
  • Scott
    Scott almost 7 years
    Same here. If you are using cordova you can set it with the cli by running cordova emulate ios --target="iPhone-6"
  • Dhaval H. Nena
    Dhaval H. Nena almost 6 years
    GENIUS !! This kind of issues are hard to find if you were in middle of adding some environment variables and you didn't add it, after hours you try to find such issue is terrible. Happened to me. Thanks for the answer :)
  • Alexander Vasenin
    Alexander Vasenin almost 6 years
    That lead me to Program specified by service does not contain any valid architectures for this system
  • Rachit Rawat
    Rachit Rawat over 5 years
    can you send me a screenshot of the same.
  • M. Leonhard
    M. Leonhard over 4 years
    Would you please tell us which environment variable was the problem?
  • Cuneyt
    Cuneyt about 4 years
    Thank you! I tried every other way and this was the fix for me, how easy! Shame on Apple for such poor error messages.