godot: **ERROR**: does not have a library for the current platform - GDNative on iOS, Godot 3.0 Beta 2

Godot version:

  • Godot 3.0 Beta 2 official
  • C++ GDNative in question that I tested was built for macOS (x86_64), and iOS (arm64, armv7, armv7s). The latter is a single fat binary.

I tested it successfully with macOS, but faced with error for iOS.

I included 2 projects to test this issue out

  1. Godot project which includes with built libraries for both platform in question
  2. Exported iOS project with further build settings setup (steps included at the end of this issue)

OS/device including version:

  • iOS 11.2.5
  • macOS 10.13

Issue description: Create a simple GDNative in C++, then integrate with Godot project. Try to export into iOS project using an updated & fixed iOS export template found here. Built and run project successfully on iOS device, but then during run-time it shows error as follows

2018-01-08 07:57:08.876729+0800 ios-export[1646:597846] [DYMTLInitPlatform] platform initialization successful
*********** main.m
running app main
2018-01-08 07:57:11.569809+0800 ios-export[1646:597729] +[CATransaction synchronize] called within transaction
after init super 0x104d0a300
2018-01-08 07:57:11.769958+0800 ios-export[1646:597729] Metal GPU Frame Capture Enabled
2018-01-08 07:57:11.776568+0800 ios-export[1646:597729] Metal API Validation Enabled
******** screen size 640, 1136
after init gles 0x104d0a300
******** adding observer for sound routing changes
******** adding observer for keyboard show/hide
glview is 0x104d0a300
Path: /var/containers/Bundle/Application/2F76ED70-16B6-42B3-BEDE-D4B11A5C7789/ios-export.app
godot_iphone /var/containers/Bundle/Application/2F76ED70-16B6-42B3-BEDE-D4B11A5C7789/ios-export.app/ios-export
cwd /private/var/containers/Bundle/Application/2F76ED70-16B6-42B3-BEDE-D4B11A5C7789/ios-export.app
os created
setting data dir to /var/mobile/Containers/Data/Application/C7E48CA1-B536-4BEB-9E40-51C6DFAB79E6/Documents from /var/mobile/Containers/Data/Application/C7E48CA1-B536-4BEB-9E40-51C6DFAB79E6/Documents
setup 0
cadisaplylink: 1start animation!
******** screen size 640, 1136
2018-01-08 07:57:12.137619+0800 ios-export[1646:597729] +[CATransaction synchronize] called within transaction
2018-01-08 07:57:12.140697+0800 ios-export[1646:597729] +[CATransaction synchronize] called within transaction
2018-01-08 07:57:12.147198+0800 ios-export[1646:597729] +[CATransaction synchronize] called within transaction
2018-01-08 07:57:12.202078+0800 ios-export[1646:597729] OpenGL ES 3.0 Renderer: Apple A9 GPU
OpenGL ES 3.0 Renderer: Apple A9 GPU
2018-01-08 07:57:12.210221+0800 ios-export[1646:597729] GLES3: max ubo light: 102
GLES3: max ubo light: 102
2018-01-08 07:57:12.210376+0800 ios-export[1646:597729] GLES3: max ubo reflections: 113, ubo size: 144
GLES3: max ubo reflections: 113, ubo size: 144
2018-01-08 07:57:12.349320+0800 ios-export[1646:597729] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
2018-01-08 07:57:12.350798+0800 ios-export[1646:597729] [MC] Reading from public effective user settings.
2018-01-08 07:57:12.542211+0800 ios-export[1646:597729] ARVR: Registered interface: Native mobile
ARVR: Registered interface: Native mobile
2018-01-08 07:57:12.629283+0800 ios-export[1646:597729] **ERROR**: Condition ' status != 0x8CD5 ' is true.
2018-01-08 07:57:12.629323+0800 ios-export[1646:597729]    At: drivers/gles3/rasterizer_storage_gles3.cpp:6334:_render_target_allocate() - Condition ' status != 0x8CD5 ' is true.
**ERROR**: Condition ' status != 0x8CD5 ' is true.
   At: drivers/gles3/rasterizer_storage_gles3.cpp:6334:_render_target_allocate() - Condition ' status != 0x8CD5 ' is true.
2018-01-08 07:57:12.630568+0800 ios-export[1646:597729] **ERROR**: Condition ' status != 0x8CD5 ' is true.
2018-01-08 07:57:12.630594+0800 ios-export[1646:597729]    At: drivers/gles3/rasterizer_storage_gles3.cpp:6334:_render_target_allocate() - Condition ' status != 0x8CD5 ' is true.
**ERROR**: Condition ' status != 0x8CD5 ' is true.
   At: drivers/gles3/rasterizer_storage_gles3.cpp:6334:_render_target_allocate() - Condition ' status != 0x8CD5 ' is true.
2018-01-08 07:57:12.741109+0800 ios-export[1646:597729] **ERROR**:  does not have a library for the current platform
2018-01-08 07:57:12.741181+0800 ios-export[1646:597729]    At: modules/gdnative/nativescript/nativescript.cpp:995:init_library() - Condition ' lib_path.length() == 0 ' is true.
**ERROR**:  does not have a library for the current platform
   At: modules/gdnative/nativescript/nativescript.cpp:995:init_library() - Condition ' lib_path.length() == 0 ' is true.
2018-01-08 07:57:12.743976+0800 ios-export[1646:597729] **SCRIPT ERROR**: Attempt to call function 'new' in base 'NativeScript' on a null instance.
2018-01-08 07:57:12.744023+0800 ios-export[1646:597729]    At: <built-in>:3:_ready() - Attempt to call function 'new' in base 'NativeScript' on a null instance.
**SCRIPT ERROR**: Attempt to call function 'new' in base 'NativeScript' on a null instance.
   At: <built-in>:3:_ready() - Attempt to call function 'new' in base 'NativeScript' on a null instance.
2018-01-08 07:57:13.227255+0800 ios-export[1646:597729] [Error] setCurrentGameFromInternal: ignoring -- nil bundleIdentifier :(null)
2018-01-08 07:57:13.331679+0800 ios-export[1646:597729] [Error] _authenticateUsingAlert:Faied to authenticate player with existing credentials.Error: Error Domain=GKErrorDomain Code=15 "The requested operation could not be completed because this application is not recognized by Game Center." UserInfo={GKServerStatusCode=5019, NSLocalizedDescription=The requested operation could not be completed because this application is not recognized by Game Center., NSUnderlyingError=0x1c445e390 {Error Domain=GKServerErrorDomain Code=5019 "status = 5019, no game matching descriptor: ios:org.godotengine.iosgame2:1.0:1.0+-1" UserInfo={GKServerStatusCode=5019, NSLocalizedFailureReason=status = 5019, no game matching descriptor: ios:org.godotengine.iosgame2:1.0:1.0+-1}}}
2018-01-08 07:57:13.362115+0800 ios-export[1646:597729] [Error] startAuthenticationForExistingPrimaryPlayer:Failed to Authenticate player.Error: Error Domain=GKErrorDomain Code=15 "The requested operation could not be completed because this application is not recognized by Game Center." UserInfo={NSLocalizedDescription=The requested operation could not be completed because this application is not recognized by Game Center.}

From full log above, the relevant part is as follows

2018-01-08 07:57:12.741109+0800 ios-export[1646:597729] **ERROR**:  does not have a library for the current platform
2018-01-08 07:57:12.741181+0800 ios-export[1646:597729]    At: modules/gdnative/nativescript/nativescript.cpp:995:init_library() - Condition ' lib_path.length() == 0 ' is true.
**ERROR**:  does not have a library for the current platform
   At: modules/gdnative/nativescript/nativescript.cpp:995:init_library() - Condition ' lib_path.length() == 0 ' is true.
2018-01-08 07:57:12.743976+0800 ios-export[1646:597729] **SCRIPT ERROR**: Attempt to call function 'new' in base 'NativeScript' on a null instance.
2018-01-08 07:57:12.744023+0800 ios-export[1646:597729]    At: <built-in>:3:_ready() - Attempt to call function 'new' in base 'NativeScript' on a null instance.
**SCRIPT ERROR**: Attempt to call function 'new' in base 'NativeScript' on a null instance.
   At: <built-in>:3:_ready() - Attempt to call function 'new' in base 'NativeScript' on a null instance.

If things run properly, it should print out followings

test
1
True

and shows Godot sprite on screen. If not, it should not print anything, and Godot sprite wouldn’t show on screen.

Steps to reproduce:

  • Try to run Godot project (see attached file) on macOS first to see whether it works
  • You can directly open attached exported Xcode project then run on iOS device to see the problem, or try to re-export iOS project from Godot editor again.
  • If you re-export from editor, you need to configure the following for Xcode project
    • Click on project name at Project Navigator panel, then click on General. At Embedded Binaries, add libsimple_library_ios_fat.dylib for both of occurrences.
    • At build settings, search for Library Search Paths, then add $(SRCROOT)/ios-export/dylibs/simple_library (this will allow compilation process to succeed, and be able to find our shared library as copied into dylibs/simple_library automatically by exporting process).
    • At build settings again, search for Runpath Search Paths, then add @executable_path/Frameworks (for some reason, I need this to be able to successfully initialize Godot at startup. If not, it crashes even before Godot’d be loaded).
  • Run the project.
  • You will see the error log like above, and see no expected results printed or any Godot sprite on screen.

Minimal reproduction project:

Edit I included information from executing otool -L libsimple_library_ios_fat.dylib here as well as reference. I have to set it to @rpath/libsimple_library_ios_fat.dylib via install_name_tool command in order to let linking step be able to find and pass through.

libsimple_library_ios_fat.dylib (architecture armv7):
	@rpath/libsimple_library_ios_fat.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.1)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
libsimple_library_ios_fat.dylib (architecture armv7s):
	@rpath/libsimple_library_ios_fat.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.1)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)
libsimple_library_ios_fat.dylib (architecture arm64):
	@rpath/libsimple_library_ios_fat.dylib (compatibility version 0.0.0, current version 0.0.0)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.1)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.0.0)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

ERROR: initialize: No library set for this platform
   At: modules/gdnative/gdnative.cpp:290.

Exactly the same problem with the same conditions here with Godot v3.3.rc6 under Arch Linux.