Hello, I know this thread is a bit old but I recently came across the same problem with the simulator and this is what helped me fix it:
Go to Edit Scheme -> Arguments -> Environment Variables
For me, I had accidentally hit the + and added an empty variable. Once I deleted that variable so there was no checkmark under, the app ran like there was no problem!
Hope this helps.