I know there are already a lot of posts about this error, but I could'nt figure out a way to fix my specific situation.
I have trouble validating/distributing a macOS application from the Xcode Organizer. When Xcode asks me to choose provisioning profiles it shows me this error:
Profile doesn't match the entitlements file's value for the com.apple.application-identifier entitlement.
StockMonitor.app has a "Copy files" build phase to move Launcher.app bundle to a subfolder.
In Xcode the provisioning profiles looks correct
When I check the entitlements from the command line after archiving I can see that for whatever reason the Launcher.app got the identifier from StockMonitor.app.
❯ codesign -d --entitlements - Launcher.app/
Executable=/Users/lukas/Library/Developer/Xcode/Archives/2022-05-23/StockMonitor 23.05.22, 14.55.xcarchive/Products/Applications/StockMonitor.app/Contents/Library/LoginItems/Launcher.app/Contents/MacOS/Launcher
[Dict]
[Key] com.apple.application-identifier
[Value]
[String] UE4U5XA7R9.de.lukaswuerzburger.stock-monitor
[Key] com.apple.developer.team-identifier
[Value]
[String] UE4U5XA7R9
[Key] com.apple.security.app-sandbox
[Value]
[Bool] true
[Key] com.apple.security.application-groups
[Value]
[Array]
[String] group.UE4U5XA7R9.de.lukaswuerzburger.stock-monitor.settings
[Key] com.apple.security.cs.disable-library-validation
[Value]
[Bool] true
[Key] com.apple.security.files.user-selected.read-only
[Value]
[Bool] true
[Key] com.apple.security.network.client
[Value]
[Bool] true
The entitlement file is here:
The build settings are like this:
It looks like Xcode takes the entitlements from StockMonitor.app and overrides the entitlements of Launcher.app. The question is how to prevent that.




