ERROR ITMS-90164/90046: Invalid Code Signing Entitlements
If someone gets here by searching for ERROR ITMS-90046 like me, my solution was to Clean it and delete all precompiled frameworks (the custom ones) and then build again. Note: The error description said something about key “aps-environment” as “development”.