XCode won't compile my apps although it will compile the exact same code on my friends computer.

I have been building two apps with my friend for a year now. Recently when trying to compile them I have been getting this error multiple times in the same file:


Value of optional type 'String?' must be unwrapped to a value of type 'String'


I git reset hard to ensure I had the same code as my friend and we checked but he does not get these errors. The error happens in both apps on seemingly unrelated places.


If I follow the suggested steps to fix the errors, I get this:


Command PhaseScriptExecution failed with a nonzero exit code


I am quite confident the code is right since those lines are the same in our app active on the app store. I think this error began when I updated to Mojave. I have tried updating Xcode, my OS and restarting everything but no luck. Any ideas?