godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.25k stars 19.99k forks source link

[macOS] Godot 4.3 Dev Snapshot 6 (Mono) - macOS App from TestFlight not working #91469

Closed Ciel1996 closed 1 week ago

Ciel1996 commented 3 months ago

Tested versions

System information

Godot v4.3.dev6.mono - macOS 14.4.1 - Vulkan (Forward+) - integrated Apple M1 - Apple M1 (8 Threads)

Issue description

I have opened a related issue a while ago, which was partially fixed with 4.3 dev 6 (PR #90428)

I use .NET 8, without AOT (because that caused errors on Apple's side).

Whenever I run the game downloaded via TestFlight I get this on startup:

TextServer: Primary interface set to: "ICU / HarfBuzz / Graphite (Built-in)".
.NET: Initializing module...
Found hostfxr: /Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib
ERROR: Can't open dynamic library: /Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib. Error: dlopen(/Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib, 0x0002): tried: '/Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (code signature invalid in <A522E666-A68E-3843-8182-1A3913D8C4C4> '/Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00057030, codeBlobSize=0x00005D80), '/System/Volumes/Preboot/Cryptexes/OS/Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (no such file), '/Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (code signature invalid in <A522E666-A68E-3843-8182-1A3913D8C4C4> '/Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00057030, codeBlobSize=0x00005D80).
   at: open_dynamic_library (platform/macos/os_macos.mm:236)
ERROR: Condition "!FileAccess::exists(path)" is true. Returning: ERR_FILE_NOT_FOUND
   at: open_dynamic_library (platform/macos/os_macos.mm:233)
ERROR: .NET: Failed to load hostfxr
   at: initialize (modules/mono/mono_gd/gd_mono.cpp:393)
CORE API HASH: 0
EDITOR API HASH: 0

Steps to reproduce

  1. Export the game to macOS for App Store
  2. Upload it via Transporter
  3. Download it via Testflight
  4. go to Applications > Game name > Right click on "Show Package Content" > go to Contents/MacOS/ and drag and drop the file to Terminal
  5. add "--verbose" option and click enter

In my case it starts as expected, but whenever the game starts executing .NET code, it just crashes with the message above

Minimal reproduction project (MRP)

I can't provide one at the moment, but I will try to create a similar project if required. However for reproduction an Apple Developer Account will also be necessary.

akien-mga commented 3 months ago

CC @bruvzg @raulsntos

bruvzg commented 3 months ago

I'm not sure what's wrong, all libs seem to be correctly signed and loading fine (I can reproduce the error only if I deliberately break signature after exporting).

Can you check signature for the file (codesign -vvvv /Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib) and bundle (codesign -vvvv /Applications/dmArtRace.app) manually? What is it showing.

Ciel1996 commented 3 months ago
codesign -vvvv  /Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib:
/Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib: valid on disk
/Applications/dmArtRace.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib: satisfies its Designated Requirement
codesign -vvvv  /Applications/dmArtRace.app:
/Applications/dmArtRace.app: valid on disk
/Applications/dmArtRace.app: satisfies its Designated Requirement
Ciel1996 commented 3 months ago

I was just thinking that this might be an issue related to .NET and maybe (hopefully 😁) only a wrong parameter when Godot exports to macOS for App Store.

Ciel1996 commented 2 months ago

I had a couple of friends and family members try it on their devices. Hoping that it had something to do with my environment. Sadly they can reproduce the issue, too.

LeonardoDemartino commented 1 month ago

https://github.com/dotnet/runtime/issues/100413

Maybe related?

LeonardoDemartino commented 1 month ago

I’m having the same issue:

The builds reaches macOS TestFlight but crashes at startup (exporting locally without signing runs works fine).

ERROR: Can't open dynamic library: /Applications/APP.app/Contents/Resources/data_PBP_macos_arm64/libhostfxr.dylib. Error: dlopen(/Applications/APP.app/Contents/Resources/data_PBP_macos_arm64/libhostfxr.dylib, 0x0002): tried: '/Applications/APP.app/Contents/Resources/data_PBP_macos_arm64/libhostfxr.dylib' (code signature invalid in '/Applications/APP.app/Contents/Resources/data_PBP_macos_arm64/libhostfxr.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00057030, codeBlobSize=0x00005C50), '/System/Volumes/Preboot/Cryptexes/OS/Applications/APP.app/Contents/Resources/data_PBP_macos_arm64/libhostfxr.dylib' (no such file), '/Applications/APP.app/Contents/Resources/data_PBP_macos_arm64/libhostfxr.dylib' (code signature invalid in '/Applications/APP.app/Contents/Resources/data_PBP_macos_arm64/libhostfxr.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00057030, codeBlobSize=0x00005C50).
at: open_dynamic_library (platform/macos/os_macos.mm:236)
ERROR: Condition "!FileAccess::exists(path)" is true. Returning: ERR_FILE_NOT_FOUND
at: open_dynamic_library (platform/macos/os_macos.mm:233)
ERROR: .NET: Failed to load hostfxr
at: initialize (modules/mono/mono_gd/gd_mono.cpp:393)
zsh: segmentation fault /Applications/APP.app/Contents/MacOS/APP

codesign -vvvv says that libhostfxr.dylib is valid at disk and satisfies its Designated Requirement. So apparently is correctly signed, but maybe it doesn’t match with the rest of signatures of the package.

Is there a command to show the signature info for a particular library/executable file?

akien-mga commented 1 month ago

Please check if #94518 fixes this too.

Ciel1996 commented 1 month ago

Hi, will do! :) I hope I get to it today!

LeonardoDemartino commented 1 month ago

94518 didn’t fix this issue ☹️. And makes sense because that PR fixes signing when sandbox = off. We are dealing with TestFlight/AppStore here so we have sandbox = on.

Could you please @bruvzg @Ciel1996 share which version of .net are you using? I’m using 8.0.1 arm64 (Apple Sillicon) downloaded from https://dotnet.microsoft.com/en-us/download

Ciel1996 commented 1 month ago

I'm also running .NET 8 arm64. Sadly haven't looked at the exact version.

I tried compiling and exporting using the master branch, but did not have time to complete the export.

Ciel1996 commented 1 month ago

Here is the output of my dotnet --info:

.NET SDK:
 Version:           8.0.201
 Commit:            4c2d78f037
 Workload version:  8.0.200-manifests.3097af8b

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  14.5
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/8.0.201/

.NET workloads installed:
There are no installed workloads to display.

Host:
  Version:      8.0.2
  Architecture: arm64
  Commit:       1381d5ebd2

.NET SDKs installed:
  6.0.302 [/usr/local/share/dotnet/sdk]
  6.0.401 [/usr/local/share/dotnet/sdk]
  6.0.402 [/usr/local/share/dotnet/sdk]
  6.0.407 [/usr/local/share/dotnet/sdk]
  6.0.408 [/usr/local/share/dotnet/sdk]
  6.0.420 [/usr/local/share/dotnet/sdk]
  7.0.202 [/usr/local/share/dotnet/sdk]
  8.0.201 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 6.0.28 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.10 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.15 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.16 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 6.0.28 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 7.0.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
  x64   [/usr/local/share/dotnet/x64]

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download
bruvzg commented 1 month ago

https://github.com/godotengine/godot/pull/94518 won't fix it, it's for opposite case (signing for distribution outside App Store). I have no idea what's exactly is wrong and how to fix it. .NET libraries or the way Godot use them might be incompatible with some undocumented App Store requirements (we might need to use full AOT, like we do for iOS, or something similar). The only thing I can suggest is disabling sandboxing (support for it is limited, and it's barely tested), and using much less restrictive distribution outside App Store with signing + notarization. Or do not use .NET, regular version of Godot should work with App Store.

LeonardoDemartino commented 1 month ago

I don't think this is 100% related to App Store distribution. Seems to be a general signing issue. If I export "Distribution" instead of "App Store" as .app bundle and run it directly (locally), the app crashes as well with:

Failed to create CoreCLR, HRESULT: 0x80070008 ERROR: hostfxr_get_runtime_delegate failed with code: -2147450743 at: initialize_hostfxr_self_contained (modules/mono/mono_gd/gd_mono.cpp:237) ERROR: Parameter "load_assembly_and_get_function_pointer" is null. at: initialize_hostfxr_and_godot_plugins (modules/mono/mono_gd/gd_mono.cpp:296) ERROR: Parameter "godot_plugins_initialize" is null. at: initialize (modules/mono/mono_gd/gd_mono.cpp:405)

If I export with signing Disabled the app runs just fine. Super strange issue.

raulsntos commented 2 weeks ago

.NET's default host has the following default entitlements:

@Ciel1996 Can you try enabling the com.apple.security.cs.disable-library-validation entitlement in the export options?

image

The other entitlements should already be enabled by default for .NET builds (after the fix in https://github.com/godotengine/godot/pull/94680). So make sure to use Godot 4.3 RC 3.

LeonardoDemartino commented 2 weeks ago

Same issue with "Disable Library Validation" enabled on 4.3 RC3.

Build uploads fine to TestFlight but crashes:

ERROR: Can't open dynamic library: /Applications/game.app/Contents/Resources/data_game_macos_arm64/libhostfxr.dylib. Error: dlopen(/Applications/game.app/Contents/Resources/data_game_macos_arm64/libhostfxr.dylib, 0x0002): tried: '/Applications/game.app/Contents/Resources/data_game_macos_arm64/libhostfxr.dylib' (code signature invalid in '/Applications/game.app/Contents/Resources/data_game_macos_arm64/libhostfxr.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00057030, codeBlobSize=0x00005D50), '/System/Volumes/Preboot/Cryptexes/OS/Applications/game.app/Contents/Resources/data_game_macos_arm64/libhostfxr.dylib' (no such file), '/Applications/game.app/Contents/Resources/data_game_macos_arm64/libhostfxr.dylib' (code signature invalid in '/Applications/game.app/Contents/Resources/data_game_macos_arm64/libhostfxr.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00057030, codeBlobSize=0x00005D50). at: open_dynamic_library (platform/macos/os_macos.mm:236) ERROR: Condition "!FileAccess::exists(path)" is true. Returning: ERR_FILE_NOT_FOUND at: open_dynamic_library (platform/macos/os_macos.mm:233) ERROR: .NET: Failed to load hostfxr at: initialize (modules/mono/mono_gd/gd_mono.cpp:393)

Ciel1996 commented 2 weeks ago

I can also still reproduce the issue using 4.3 RC3

ERROR: Can't open dynamic library: /Applications/Unnamed.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib. Error: dlopen(/Applications/Unnamed.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib, 0x0002): tried: '/Applications/Unnamed.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (code signature invalid in <A522E666-A68E-3843-8182-1A3913D8C4C4> '/Applications/Unnamed.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00057030, codeBlobSize=0x00005DC0), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Unnamed.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (no such file), '/Applications/Unnamed.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (code signature invalid in <A522E666-A68E-3843-8182-1A3913D8C4C4> '/Applications/Unnamed.app/Contents/Resources/data_Art-Race_macos_arm64/libhostfxr.dylib' (errno=1) sliceOffset=0x00000000, codeBlobOffset=0x00057030, codeBlobSize=0x00005DC0).
   at: open_dynamic_library (platform/macos/os_macos.mm:236)
ERROR: Condition "!FileAccess::exists(path)" is true. Returning: ERR_FILE_NOT_FOUND
   at: open_dynamic_library (platform/macos/os_macos.mm:233)
ERROR: .NET: Failed to load hostfxr
   at: initialize (modules/mono/mono_gd/gd_mono.cpp:393)
LeonardoDemartino commented 2 weeks ago

This reports TestFlight about the entitlements of my latest build with RC3 and disable-library-validation: true.

Entitlements game.app/Contents/Resources/data_game_macos_arm64/libcoreclr.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/createdump com.apple.security.app-sandbox: true com.apple.security.inherit: true game.app/Contents/MacOS/game com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libhostpolicy.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libclrgc.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libSystem.Security.Cryptography.Native.OpenSsl.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libSystem.IO.Compression.Native.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libhostpolicy.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libSystem.Security.Cryptography.Native.OpenSsl.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libmscordaccore.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libSystem.Security.Cryptography.Native.Apple.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libhostfxr.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libclrjit.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libSystem.Native.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libclrjit.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libmscordbi.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libmscordaccore.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libSystem.Net.Security.Native.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libSystem.Globalization.Native.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libclrgc.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libhostfxr.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libSystem.IO.Compression.Native.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libmscordbi.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libSystem.Security.Cryptography.Native.Apple.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libSystem.Native.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libcoreclr.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/libSystem.Globalization.Native.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_arm64/libSystem.Net.Security.Native.dylib com.apple.application-identifier: [TEAM_ID].com.game.macos com.apple.security.cs.disable-library-validation: true com.apple.security.cs.allow-jit: true com.apple.developer.team-identifier: [TEAM_ID] com.apple.security.cs.allow-unsigned-executable-memory: true com.apple.security.app-sandbox: true com.apple.security.cs.allow-dyld-environment-variables: true game.app/Contents/Resources/data_game_macos_x86_64/createdump com.apple.security.app-sandbox: true com.apple.security.inherit: true

Ciel1996 commented 2 weeks ago

And here's mine:

[GAME_NAME].app/Contents/MacOS/[GAME_NAME]
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libSystem.IO.Compression.Native.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libSystem.Native.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libSystem.Globalization.Native.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libSystem.Security.Cryptography.Native.Apple.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libclrgc.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/createdump
    com.apple.security.app-sandbox: true
    com.apple.security.inherit: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libcoreclr.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libclrgc.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libmscordbi.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libclrjit.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libSystem.Globalization.Native.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libcoreclr.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/createdump
    com.apple.security.app-sandbox: true
    com.apple.security.inherit: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libmscordaccore.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libSystem.Net.Security.Native.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libSystem.IO.Compression.Native.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libhostfxr.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libhostpolicy.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libclrjit.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libSystem.Security.Cryptography.Native.OpenSsl.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libSystem.Security.Cryptography.Native.OpenSsl.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libmscordbi.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libSystem.Native.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libhostpolicy.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libhostfxr.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libSystem.Security.Cryptography.Native.Apple.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_x86_64/libSystem.Net.Security.Native.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
[GAME_NAME].app/Contents/Resources/data_[PROJECT_NAME]_macos_arm64/libmscordaccore.dylib
    com.apple.application-identifier: [TEAM_ID].[BUNDLE_ID]
    com.apple.security.network.server: true
    com.apple.security.cs.disable-library-validation: true
    com.apple.security.cs.allow-jit: true
    com.apple.developer.team-identifier: [TEAM_ID]
    com.apple.security.app-sandbox: true
    com.apple.security.network.client: true
    com.apple.security.cs.allow-unsigned-executable-memory: true
    com.apple.security.cs.allow-dyld-environment-variables: true
LeonardoDemartino commented 2 weeks ago

I'm wondering if the issue is related to Godot re signing and using the same team id for the C# runtime dlls. As you can see com.apple.developer.team-identifier shows whatever Godot puts in there (even for external dlls/dylib probably signed by someone else) instead of the original team id (Microsoft?).

According to the Apple docs, Disable Library Validation is used when the Team ID differs between the main executable and the libraries. Godot makes them match:

prevents a program from loading frameworks, plug-ins, or libraries unless they’re either signed by Apple or signed with the same Team ID as the main executable. Use the Disable Library Validation Entitlement if your program loads plug-ins that are signed by other third-party developers.

https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_disable-library-validation?language=objc#

raulsntos commented 1 week ago

It seems Apple re-signs apps published through the App Store, and it's possible that it didn't re-sign libhostfxr.dylib because it's in a non-standard location (/Contents/Resources instead of /Contents/Frameworks). Can you check with codesign --display -vvv that the game.app and libhostfxr.dylib are signed with the same signature after going through the App Store?

LeonardoDemartino commented 1 week ago

Sure!

game.app

Executable=/Applications/game.app/Contents/MacOS/game Identifier=com.game.macos Format=app bundle with Mach-O universal (x86_64 arm64) CodeDirectory v=20500 size=566046 flags=0x10000(runtime) hashes=17678+7 location=embedded Hash type=sha256 size=32 CandidateCDHash sha1=4f2d0c716b6ba37830294d82187d06b12d27d486 CandidateCDHashFull sha1=4f2d0c716b6ba37830294d82187d06b12d27d486 CandidateCDHash sha256=79745e2b1843c92f2b5532c9a86f666569cbe72d CandidateCDHashFull sha256=79745e2b1843c92f2b5532c9a86f666569cbe72dddfb919aa034abef74bd74ea Hash choices=sha1,sha256 CMSDigest=bd85d2c26166ca128f6bf573aa2a0b1390152ba12d983ff361d2480d7db8f389 CMSDigestType=2 CDHash=79745e2b1843c92f2b5532c9a86f666569cbe72d Signature size=4844 Authority=TestFlight Beta Distribution Authority=Apple Worldwide Developer Relations Certification Authority Authority=Apple Root CA Info.plist entries=27 TeamIdentifier=[TEAM_ID] Runtime Version=14.5.0 Sealed Resources version=2 rules=13 files=375 Internal requirements count=1 size=100

libhostfxr.dylib

Executable=/Applications/game.app/Contents/Resources/data_game_macos_arm64/libhostfxr.dylib Identifier=libhostfxr Format=Mach-O thin (arm64) CodeDirectory v=20500 size=3094 flags=0x10000(runtime) hashes=88+5 location=embedded Hash type=sha256 size=32 CandidateCDHash sha1=494d6247bdb502bfabe400a6103202a42c7e9c32 CandidateCDHashFull sha1=494d6247bdb502bfabe400a6103202a42c7e9c32 CandidateCDHash sha256=ad0b0b23c11da52f886e5550769c9f2b4c03543a CandidateCDHashFull sha256=ad0b0b23c11da52f886e5550769c9f2b4c03543aebe99de37cc2339dcf00e5d1 Hash choices=sha1,sha256 CMSDigest=933567d21346152fe578e3d8707ae34054f9fd7362fa9976b61fa6156ca34542 CMSDigestType=2 CDHash=ad0b0b23c11da52f886e5550769c9f2b4c03543a Signature size=4844 Authority=TestFlight Beta Distribution Authority=Apple Worldwide Developer Relations Certification Authority Authority=Apple Root CA Info.plist=not bound TeamIdentifier=[TEAM_ID] Runtime Version=13.1.0 Sealed Resources=none Internal requirements count=1 size=92

LeonardoDemartino commented 1 week ago

Apparently Godot is signing stuff with the "--deep" command: https://github.com/godotengine/godot/blob/39fc116c5fed3a434aa35087a87d58d518b1033a/platform/macos/SCsub#L55

Which is something that could cause this kind of errors on Library code, according to this thread:

Screenshot 2024-08-12 at 5 14 28 PM

https://developer.apple.com/forums/thread/706437

bruvzg commented 1 week ago

This --deep is not related to export, it's for local development build of the editor. But not setting entitlements for the dylibs might be related (exporter do set the same entitlements for them as for the main executable).

raulsntos commented 1 week ago

There may be more information in the Console logs (https://support.apple.com/en-in/guide/console/welcome/mac). Can you share the logs for when the problem occurs?

LeonardoDemartino commented 1 week ago

Sure, I think this confirms what we were talking about earlier:

default 14:19:50.894717-0300 kernel AMFI: constraint violation /Applications/game.app/Contents/Resources/data_game_macos_x86_64/libhostfxr.dylib has entitlements but is not a main binary default 14:19:50.903027-0300 taskgated-helper @@@@@ CP_ProvisioningProfilesAreInstalled CP_ProvisioningProfilesAreInstalledHintFlagFileLocation CHECK_FF default 14:19:50.903414-0300 ManagedClient MCX_ConfigCoreData.profilesForUserAsCPProfile USER profiles; guid = default 14:19:50.903820-0300 ManagedClient MCX_ConfigCoreData.profilesForUserAsCPProfile found some profiles. (n=1) default 14:19:50.909679-0300 taskgated-helper Checking profile: game macOS default 14:19:50.910109-0300 taskgated-helper Profile does not have matching hash error 14:19:50.910168-0300 taskgated-helper libhostfxr: Unsatisfied entitlements: com.apple.developer.team-identifier error 14:19:50.910228-0300 taskgated-helper Disallowing: libhostfxr default 14:19:50.910620-0300 taskgated-helper [0x142810f90] invalidated after getting a no-senders notification - client is gone error 14:19:50.910801-0300 amfid Failure validating against provisioning profiles: error 14:19:50.910897-0300 amfid Restricted entitlements not validated, bailing out. Error: Error Domain=AppleMobileFileIntegrityError Code=-413 "No matching profile found" UserInfo={NSURL=, unsatisfiedEntitlements=, NSLocalizedDescription=No matching profile found} default 14:19:50.912524-0300 kernel AMFI: code signature validation failed. default 14:19:50.912240-0300 amfid /Applications/game.app/Contents/Resources/data_game_macos_x86_64/libhostfxr.dylib not valid: Error Domain=AppleMobileFileIntegrityError Code=-413 "No matching profile found" UserInfo={NSURL=file:///Applications/game.app/Contents/Resources/data_game_macos_x86_64/libhostfxr.dylib, unsatisfiedEntitlements=<CFArray 0x15bd07350 [0x204c408c0]>{type = immutable, count = 1, values = ( 0 : <CFString 0x15bd0b8f0 [0x204c408c0]>{contents = "com.apple.developer.team-identifier"} )}, NSLocalizedDescription=No matching profile found}

Btw, it shows the same for all the other dylibs, I have shortened the log for better readability.

LeonardoDemartino commented 1 week ago

Apparently I have fixed the issue. I have a working build directly from TestFlight! :D