godotengine / godotengine/godot
Unable to run C# applications on iOS due to code signing identifier mismatch
- Dominant language
- C++
- Stars
- 117k
- Forks
- 26.8k
- PR merge metrics
- PR metrics pending
Description
### Tested versions
Reproducible in Godot 4.5.1 and 4.6.0
### System information
Godot v4.6.stable.mono - macOS Tahoe (26.2.0) - Multi-window, 3 monitors - Metal (Forward+) - integrated Apple M1 Max (Apple7) - Apple M1 Max (10 threads) - 32.00 GiB memory
### Issue description
Exporting and running a simple C# application results in the following errors:
```
Unable to Install “com.godotrepro.signingtest”
Domain: IDEInstallLocalMacService
Code: 1
Failure Reason: Please try again later.
Recovery Suggestion: Code signing identifier (csharp-ios-signing) does not match bundle identifier (com.godotrepro.signingtest.framework.csharp-ios-signing) for /var/db/appinstalld/Library/Caches/com.apple.mobile.installd.staging/temp.ZaO7Ow/extracted/signing-test.app/Frameworks/csharp-ios-signing.framework
```
### Steps to reproduce
Repro:
- Create a new C# project.
- Add some C# code.
- Create the export config for iOS, filling in the team ID and bundle identifier.
- Export.
- Open the resulting project in XCode and run.
- Note the error.
One guess is the generated code is being signed with the wrong identifier - the name of the app, rather than the generated code's framework bundle id. I was able to work around it by manually creating a build phase that re-signed the framework with the correct id, like so:
```
FRAMEWORK="${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/csharp-ios-signing.framework"
if [ -d "$FRAMEWORK" ]; then
echo "Re-signing framework with correct identifier"
/usr/bin/codesign --force --sign "${EXPANDED_CODE_SIGN_IDENTITY}" \
--identifier "com.godotrepro.signingtest.framework.csharp-ios-signing" \
--preserve-metadata=entitlements \
"$FRAMEWORK"
fi
```
I've attached an example project - only the developer ID needs to be filled in.
I'm suspicious I'm doing something wrong, since this seems quite serious for C# iOS exports; if so, my apologies!
### Minimal reproduction project (MRP)
[csharp-ios-signing.zip](https://github.com/user-attachments/files/25231077/csharp-ios-signing.zip)
Contributor guide
Assessment
This issue has not been assessed yet.