My app runs fine in the simulator, but when I try to install it on my iPhone it says
App installation failed: An unknown error has occurred.
I had the same problem but with an app without app extension on XCode 10.2.1.
None of the solutions worked for me, so I deleted the XCode target and recreated it with the same files and settings. This worked for me.