godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.66k stars 502 forks source link

MacOS release with GDNative throws validation error. #592

Open SnailBones opened 3 years ago

SnailBones commented 3 years ago

I've released windows and Linux builds for this game, but I'm encountering a unique issue on Mac. The game works fine in the editor, but after export it appears as a blank screen and complains that my .dylib is not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)

Here's the start of the log file:

Godot Engine v3.3.2.stable.official - https://godotengine.org
OpenGL ES 3.0 Renderer: Intel(R) Iris(TM) Plus Graphics OpenGL Engine
OpenGL ES Batching: ON

Registered camera FaceTime HD Camera (Built-in) with id 1 position 0 at index 0
**ERROR**: Can't open dynamic library: /Users/snailbones/CellForest/release/A Tree Falls.app/Contents/MacOS/../Frameworks/libcell.dylib, error: dlopen(/Users/snailbones/CellForest/release/A Tree Falls.app/Contents/MacOS/../Frameworks/libcell.dylib, 2): no suitable image found.  Did find:
    /Users/snailbones/CellForest/release/A Tree Falls.app/Contents/MacOS/../Frameworks/libcell.dylib: code signature in (/Users/snailbones/CellForest/release/A Tree Falls.app/Contents/MacOS/../Frameworks/libcell.dylib) not valid for use in process using Library Validation: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?).
   At: platform/osx/os_osx.mm:1944:open_dynamic_library() - Condition "!p_library_handle" is true. Returned: ERR_CANT_OPEN
**ERROR**: No valid library handle, can't get symbol from GDNative object
   At: modules/gdnative/gdnative.cpp:502:get_symbol() - No valid library handle, can't get symbol from GDNative object
**ERROR**: No nativescript_init in "res://bin/osx/libcell.dylib" found
   At: modules/gdnative/nativescript/nativescript.cpp:1482:init_library() - No nativescript_init in "res://bin/osx/libcell.dylib" found

This issue with godot-git-plugin may be related.

bruvzg commented 3 years ago

Select "disable library validation" entitlement in the export settings, it is required to load libraries with the different signature or no/ad-hoc signature.

SnailBones commented 3 years ago

Thanks @bruvzg, that worked like a charm! Having this in the documentation would've been helpful.