I am using El Capitan
and Xcode 7.1 , I am trying to build and archive my application to upload to app store . After compiling this alert pops up :
but
I had the same issue, and I looked for a really long time. I actually found this answer while having a similar issue on a pop up box on Microsoft word that wouldn't work.
The fix that I used is to restart the computer and power it on in safe mode (https://support.apple.com/en-us/HT201262), open up Xcode (you may need to install components), and try Archiving it again. This time, when you click always allow, it should work.
Hope this helps!