Open AdrKacz opened 1 year ago
This repository hasn't been updated for Godot 4 yet, as its maintainer @naithar is no longer available. There is no updated version I know of yet.
The master
branch (development branch) has mentions of Godot 4 🤔 Do you have context regarding if the work to update to Godot 4 has been started? If yes, do you have context regarding the stage of the update -early, middle, close to finish-?
EDIT: It works for me, at least when I tested the InAppStore today. For anyone else wanting to use this with Godot 4.0.2 (which is what I used), do this:
Also, very important: For the plugin to work, it has to be in the folder res://ios/plugins
, both the .a and the .gdip file (which you have to copy-paste from the repo folder), otherwise it will not be recognized by the Godot Engine. Don't forget to turn it on in the export settings -> options tab.
I will try the GameCenter plugin tomorrow, hopefully I can get that running as well.
The compilation tutorial from README worked for me at Godot 4.1
/ $ git clone --recursive https://github.com/godotengine/godot-ios-plugins.git godotIOSPlugins4.1
/godotIOSPlugins4.1/godot/ $ git fetch
/godotIOSPlugins4.1/godot/ $ git checkout 9704596 # commit from which my GodotEngine was build (4.1)
/godotIOSPlugins4.1/godot/ $ scons platform=ios target=template_debug # ^C after headers was build
/godotIOSPlugins4.1/ $ scons target=release_debug arch=arm64 simulator=no plugin=icloud version=4.0
/godotIOSPlugins4.1/ $ ./scripts/generate_static_library.sh icloud release_debug 4.0
/godotIOSPlugins4.1/ $ ./scripts/generate_xcframework.sh icloud release_debug 4.0
Compiled, tested and working on iPhone.
var icloud = Engine.get_singleton('ICloud')
icloud.set_key_values({key: v})
@saletrak Hi, I'm compiling an ios plugin for Godot4, but I've run into a problem, when I execute generate_static_library.sh
, I get the following error message, which is very frustrating:
$ cd godot_plugs_path
$ ./generate_static_library.sh icloud release_debug 4.0
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o plugins/icloud/icloud_module.o -c -fomit-frame-pointer -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DVULKAN_ENABLED -std=gnu++17 -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DIPHONE_ENABLED -DUNIX_ENABLED -DCOREAUDIO_ENABLED -fmodules -fcxx-modules -miphoneos-version-min=10.0 -fobjc-arc -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -fno-exceptions -Wno-ambiguous-macro -Wall -Werror=return-type -arch arm64 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/main -Igodot/core -Igodot/core/os -Igodot/core/config -Igodot/platform/ios -Igodot/modules -Igodot/scene -Igodot/servers -Igodot/drivers -Igodot/thirdparty plugins/icloud/icloud_module.cpp
While building module 'std' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/c++/v1/stdint.h:123:
While building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/c++/v1/ctype.h:38:
In file included from <module-includes>:98:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/wchar.h:91:
In file included from godot/core/os/time.h:34:
In file included from godot/core/object/class_db.h:34:
In file included from godot/core/object/method_bind.h:34:
In file included from godot/core/variant/binder_common.h:35:
In file included from godot/core/object/object.h:35:
In file included from godot/core/object/message_queue.h:34:
In file included from godot/core/object/object_id.h:34:
godot/core/typedefs.h:45:10: fatal error: cyclic dependency in module 'std': std -> Darwin -> std [4]
#include <cstdint>
^
While building module 'std' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/c++/v1/stdint.h:123:
In file included from <module-includes>:2:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/c++/v1/ctype.h:38:15:{38:2-38:16}: fatal error: could not build module 'Darwin' [4]
#include_next <ctype.h>
~~~~~~~~~~~~~^
In file included from plugins/icloud/icloud_module.cpp:36:
In file included from godot/core/config/engine.h:34:
In file included from godot/core/os/main_loop.h:34:
In file included from godot/core/input/input_event.h:35:
In file included from godot/core/io/resource.h:34:
In file included from godot/core/io/resource_uid.h:34:
In file included from godot/core/object/ref_counted.h:34:
In file included from godot/core/object/class_db.h:34:
In file included from godot/core/object/method_bind.h:34:
In file included from godot/core/variant/binder_common.h:35:
In file included from godot/core/object/object.h:34:
In file included from godot/core/extension/gdextension_interface.h:39:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/c++/v1/stdint.h:123:15:{123:2-123:16}: fatal error: could not build module 'std' [4]
#include_next <stdint.h>
~~~~~~~~~~~~~^
3 errors generated.
scons: *** [plugins/icloud/icloud_module.o] Error 1
scons: building terminated because of errors.
I noticed the error messages suggested above, such as fatal error: cyclic dependency in module 'std': std -> Darwin -> std
, but I don't know how to deal with them.
I hope to get some help and advice, thanks~~~
My Mac environment information:
@HouWan I feel you but I'm not sure I can help with this. Make sure the ios sdk is valid for your iOS version (16.4 as i can see). Just try to export Godot project and run it on simulator or real device. Without valid SKD, you would not be able to compile the game even without this plugin. Mayby you need to purge installed sdk. You can also try to build godot-ios-plugin template, and check if the error is still there: https://github.com/naithar/godot_ios_plugin
You can also try to update the command line tools (https://mac.install.guide/commandlinetools/index.html)
clang --version
Apple clang version 13.0.0 (clang-1300.0.27.3)
Target: x86_64-apple-darwin21.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
For being clear I build this plugin on:
Not sure does it metter.
my godot version is 4.1.1 stable Mac OS: 12.6 clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin`
Xcode version:14.1 (14B47b)
use the plugins: inappstore of the last version 3.5 export iOS debug version get the error:
Undefined symbols for architecture arm64:
"_err_print_error(char const*, char const*, int, char const*, ErrorHandlerType)", referenced from:
InAppStore::request_product_info(Dictionary) in inappstore-device.release_debug.a(in_app_store.o)
InAppStore::purchase(Dictionary) in inappstore-device.release_debug.a(in_app_store.o)
InAppStore::InAppStore() in inappstore-device.release_debug.a(in_app_store.o)
InAppStore::~InAppStore() in inappstore-device.release_debug.a(in_app_store.o)
MethodBind1R<Error, Dictionary>::call(Object*, Variant const**, int, Variant::CallError&) in inappstore-device.release_debug.a(in_app_store.o)
MethodBind0R<Error>::call(Object*, Variant const**, int, Variant::CallError&) in inappstore-device.release_debug.a(in_app_store.o)
MethodBind0R<int>::call(Object*, Variant const**, int, Variant::CallError&) in inappstore-device.release_debug.a(in_app_store.o)
...
"_err_print_error(char const*, char const*, int, char const*, char const*, ErrorHandlerType)", referenced from:
PoolVector<String>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
"_err_print_index_error(char const*, char const*, int, long long, long long, char const*, char const*, char const*, bool)", referenced from:
-[GodotProductsDelegate productsRequest:didReceiveResponse:] in inappstore-device.release_debug.a(in_app_store.o)
InAppStore::request_product_info(Dictionary) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::set(int, String const&) in inappstore-device.release_debug.a(in_app_store.o)
(maybe you meant: _err_print_index_error(char const*, char const*, int, long long, long long, char const*, char const*, char const*, bool, bool))
"D_METHOD(char const*)", referenced from:
InAppStore::_bind_methods() in inappstore-device.release_debug.a(in_app_store.o)
"MemoryPool::max_memory", referenced from:
PoolVector<String>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
"MemoryPool::alloc_count", referenced from:
PoolVector<String>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
"MemoryPool::alloc_mutex", referenced from:
PoolVector<String>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
"MemoryPool::allocs_used", referenced from:
PoolVector<String>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
"MemoryPool::memory_pool", referenced from:
PoolVector<String>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
"MemoryPool::total_memory", referenced from:
PoolVector<String>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
"MemoryPool::free_list", referenced from:
PoolVector<String>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_unreference() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<String>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::resize(int) in inappstore-device.release_debug.a(in_app_store.o)
PoolVector<float>::_copy_on_write() in inappstore-device.release_debug.a(in_app_store.o)
"StringName::StringName(char const*)", referenced from:
register_inappstore_types() in inappstore-device.release_debug.a(in_app_store_module.o)
InAppStore::_get_property_listv(List<PropertyInfo, DefaultAllocator>*, bool) const in inappstore-device.release_debug.a(in_app_store.o)
(maybe you meant: StringName::StringName(char const*, bool))
"StringName::StringName(String const&)", referenced from:
InAppStore::_get_class_namev() const in inappstore-device.release_debug.a(in_app_store.o)
void ClassDB::_add_class<InAppStore>() in inappstore-device.release_debug.a(in_app_store.o)
MethodBind* create_method_bind<InAppStore, Error, Dictionary>(Error (InAppStore::*)(Dictionary)) in inappstore-device.release_debug.a(in_app_store.o)
MethodBind* create_method_bind<InAppStore, Error>(Error (InAppStore::*)()) in inappstore-device.release_debug.a(in_app_store.o)
MethodBind* create_method_bind<InAppStore, int>(int (InAppStore::*)()) in inappstore-device.release_debug.a(in_app_store.o)
MethodBind* create_method_bind<InAppStore, Variant>(Variant (InAppStore::*)()) in inappstore-device.release_debug.a(in_app_store.o)
MethodBind* create_method_bind<InAppStore, String>(void (InAppStore::*)(String)) in inappstore-device.release_debug.a(in_app_store.o)
...
(maybe you meant: StringName::StringName(String const&, bool))
"StringName::StringName()", referenced from:
InAppStore::InAppStore() in inappstore-device.release_debug.a(in_app_store.o)
InAppStore::_get_property_listv(List<PropertyInfo, DefaultAllocator>*, bool) const in inappstore-device.release_debug.a(in_app_store.o)
MethodBind1R<Error, Dictionary>::MethodBind1R() in inappstore-device.release_debug.a(in_app_store.o)
MethodBind1R<Error, Dictionary>::_gen_argument_type_info(int) const in inappstore-device.release_debug.a(in_app_store.o)
GetTypeInfo<Dictionary, void>::get_class_info() in inappstore-device.release_debug.a(in_app_store.o)
MethodBind0R<Error>::MethodBind0R() in inappstore-device.release_debug.a(in_app_store.o)
MethodBind0R<Error>::_gen_argument_type_info(int) const in inappstore-device.release_debug.a(in_app_store.o)
...
"Engine::Singleton::Singleton(StringName const&, Object*)", referenced from:
register_inappstore_types() in inappstore-device.release_debug.a(in_app_store_module.o)
(maybe you meant: Engine::Singleton::Singleton(StringName const&, Object*, StringName const&))
"Object::call_multilevel(StringName const&, Variant const**, int)", referenced from:
vtable for InAppStore in inappstore-device.release_debug.a(in_app_store.o)
"Object::_changed_callback(Object*, char const*)", referenced from:
vtable for InAppStore in inappstore-device.release_debug.a(in_app_store.o)
"Object::call_multilevel_reversed(StringName const&, Variant const**, int)", referenced from:
vtable for InAppStore in inappstore-device.release_debug.a(in_app_store.o)
"Object::call(StringName const&, Variant const**, int, Variant::CallError&)", referenced from:
vtable for InAppStore in inappstore-device.release_debug.a(in_app_store.o)
"ClassDB::bind_methodfi(unsigned int, MethodBind*, MethodDefinition const&, Variant const**, int)", referenced from:
InAppStore::_bind_methods() in inappstore-device.release_debug.a(in_app_store.o)
"ClassDB::get_property_list(StringName, List<PropertyInfo, DefaultAllocator>*, bool, Object const*)", referenced from:
InAppStore::_get_property_listv(List<PropertyInfo, DefaultAllocator>*, bool) const in inappstore-device.release_debug.a(in_app_store.o)
"Variant::clear()", referenced from:
-[GodotProductsDelegate request:didFailWithError:] in inappstore-device.release_debug.a(in_app_store.o)
-[GodotProductsDelegate productsRequest:didReceiveResponse:] in inappstore-device.release_debug.a(in_app_store.o)
-[GodotTransactionsObserver paymentQueue:updatedTransactions:] in inappstore-device.release_debug.a(in_app_store.o)
InAppStore::request_product_info(Dictionary) in inappstore-device.release_debug.a(in_app_store.o)
InAppStore::purchase(Dictionary) in inappstore-device.release_debug.a(in_app_store.o)
InAppStore::pop_pending_event() in inappstore-device.release_debug.a(in_app_store.o)
MethodBind1R<Error, Dictionary>::call(Object*, Variant const**, int, Variant::CallError&) in inappstore-device.release_debug.a(in_app_store.o)
...
"Variant::Variant(PoolVector<String> const&)", referenced from:
-[GodotProductsDelegate productsRequest:didReceiveResponse:] in inappstore-device.release_debug.a(in_app_store.o)
"Variant::Variant(PoolVector<float> const&)", referenced from:
-[GodotProductsDelegate productsRequest:didReceiveResponse:] in inappstore-device.release_debug.a(in_app_store.o)
"Object::get_translatable_strings(List<String, DefaultAllocator>*) const", referenced from:
vtable for InAppStore in inappstore-device.release_debug.a(in_app_store.o)
"Variant::operator PoolVector<String>() const", referenced from:
InAppStore::request_product_info(Dictionary) in inappstore-device.release_debug.a(in_app_store.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
how can I fix it? thanks
my godot version is 4.1.1 stable
use the plugins: inappstore of the last version 3.5 export iOS debug version get the error:
You need to compile the export templates for 4.1.1, the ones from an older version won't work (see above for more on compiling)
my godot version is 4.1.1 stable
use the plugins: inappstore of the last version 3.5 export iOS debug version get the error:
You need to compile the export templates for 4.1.1, the ones from an older version won't work (see above for more on compiling)
Hello I means is inappstore plugin version is 3.5. my godot and export template are 4.1.1. the inappstore plugin download form this.
You need to compile the export templates for 4.1.1, the ones from an older version won't work (see above for more on compiling)
Hello I means is inappstore plugin version is 3.5. my godot and export template are 4.1.1. the inappstore plugin download form this.
Sorry my bad - I meant this plugin, not the export templates - you need to compile it for 4.1.1
You need to compile the export templates for 4.1.1, the ones from an older version won't work (see above for more on compiling)
Hello I means is inappstore plugin version is 3.5. my godot and export template are 4.1.1. the inappstore plugin download form this.
Sorry my bad - I meant this plugin, not the export templates - you need to compile it for 4.1.1
I am a godot novice, I was directly downloaded the 3.5 package before, so it failed, now according to the readme own compilation finally can, thank you brother
The compilation tutorial from README worked for me at Godot 4.1
/ $ git clone --recursive https://github.com/godotengine/godot-ios-plugins.git godotIOSPlugins4.1 /godotIOSPlugins4.1/godot/ $ git fetch /godotIOSPlugins4.1/godot/ $ git checkout 9704596 # commit from which my GodotEngine was build (4.1) /godotIOSPlugins4.1/godot/ $ scons platform=ios target=template_debug # ^C after headers was build /godotIOSPlugins4.1/ $ scons target=release_debug arch=arm64 simulator=no plugin=icloud version=4.0 /godotIOSPlugins4.1/ $ ./scripts/generate_static_library.sh icloud release_debug 4.0 /godotIOSPlugins4.1/ $ ./scripts/generate_xcframework.sh icloud release_debug 4.0
Compiled, tested and working on iPhone.
var icloud = Engine.get_singleton('ICloud') icloud.set_key_values({key: v})
hey! not directly related to this thread - but how are you applying the iCloud capability on Godot export - is there a way that this can be done automatically?
Thanks!
@phil-hudson I add it manually to project in XCode, every time after project is exported. Did not found any other solution.
ah in the end, i found i could copy over the entitlements file with fastlane, like this - works well!
copy_artifacts(
target_path: "./builds/ios/debug/AppName_RELEASE",
artifacts: ["./ios/config/AppName_RELEASE.entitlements"]
)
@phil-hudson I add it manually to project in XCode, every time after project is exported. Did not found any other solution.
you can see this https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_ios.html#active-development-considerations
Hi, I am trying to get the Arkit plugin working on Godot 4.1 but have not succeeded yet. I have made some changes to the plugin code in this fork: https://github.com/Snowdaw/godot-ios-plugins
I am currently facing compilation errors for the following things:
Vector<BlitToScreen> post_draw_viewport(RID p_render_target, const Rect2 &p_screen_rect)
tracking_state
is unavailable. Which is defined in the mobile_vr_interface and openxr_interface.XRPositionalTracker
has been seemingly removed. Together with some other renamings/revisions I havent figured out.Compilation log:
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
g++ -o plugins/arkit/arkit_interface.o -c -fomit-frame-pointer -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DVULKAN_ENABLED -std=gnu++17 -DNEED_LONG_INT -DLIBYUV_DISABLE_NEON -DIOS_ENABLED -DUNIX_ENABLED -DCOREAUDIO_ENABLED -fmodules -fcxx-modules -miphoneos-version-min=10.0 -fobjc-arc -fmessage-length=0 -fno-strict-aliasing -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -fpascal-strings -fblocks -fvisibility=hidden -MMD -MT dependencies -fno-exceptions -Wno-ambiguous-macro -Wall -Werror=return-type -arch arm64 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/platform/ios plugins/arkit/arkit_interface.mm
plugins/arkit/arkit_interface.mm:431:1: error: non-void function does not return a value [-Werror,-Wreturn-type,2]
}
^
plugins/arkit/arkit_interface.mm:463:2: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations,34]
sprintf(tracker_name, "Anchor %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", p_uuid[0], p_uuid[1], p_uuid[2], p_uuid[3], p_uuid[4], p_uuid[5], p_uuid[6], p_uuid[7], p_uuid[8], p_uuid[9], p_uuid[10], p_uuid[11], p_uuid[12], p_uuid[13], p_uuid[14], p_uuid[15]);
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here [2]
__deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS16.4.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
#define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
^
plugins/arkit/arkit_interface.mm:716:6: error: use of undeclared identifier 'tracking_state' [2]
tracking_state = GODOT_AR_STATE_NOT_TRACKING;
^
plugins/arkit/arkit_interface.mm:719:7: error: use of undeclared identifier 'tracking_state' [2]
tracking_state = GODOT_AR_STATE_NOT_TRACKING;
^
plugins/arkit/arkit_interface.mm:721:7: error: use of undeclared identifier 'tracking_state' [2]
tracking_state = GODOT_AR_STATE_EXCESSIVE_MOTION;
^
plugins/arkit/arkit_interface.mm:723:7: error: use of undeclared identifier 'tracking_state' [2]
tracking_state = GODOT_AR_STATE_INSUFFICIENT_FEATURES;
^
plugins/arkit/arkit_interface.mm:725:7: error: use of undeclared identifier 'tracking_state' [2]
tracking_state = GODOT_AR_STATE_UNKNOWN_TRACKING;
^
plugins/arkit/arkit_interface.mm:834:15:{834:6-834:13}: error: no member named 'set_mesh' in 'XRPositionalTracker' [2]
tracker->set_mesh(surftool->commit());
~~~~~~~ ^
plugins/arkit/arkit_interface.mm:837:15:{837:6-837:13}: error: no member named 'set_mesh' in 'XRPositionalTracker' [2]
tracker->set_mesh(nomesh);
~~~~~~~ ^
plugins/arkit/arkit_interface.mm:841:14:{841:5-841:12}: error: no member named 'set_mesh' in 'XRPositionalTracker' [2]
tracker->set_mesh(nomesh);
~~~~~~~ ^
plugins/arkit/arkit_interface.mm:857:13:{857:4-857:11}: error: no member named 'set_orientation' in 'XRPositionalTracker' [2]
tracker->set_orientation(b);
~~~~~~~ ^
plugins/arkit/arkit_interface.mm:858:13:{858:4-858:11}: error: no member named 'set_rw_position' in 'XRPositionalTracker' [2]
tracker->set_rw_position(Vector3(m44.columns[3][0], m44.columns[3][1], m44.columns[3][2]));
~~~~~~~ ^
1 warning and 11 errors generated.
scons: *** [plugins/arkit/arkit_interface.o] Error 1
scons: building terminated because of errors.
I am not familiar with the codebase nor experienced in C++ but a slight nudge may help this cross the finish line.
Hey @Snowdaw ,
Also reacted on your discord message so just copying the feedback I gave there:
I'm not sure if for ARKit it makes sense to keep this as an ios plugin or if it would be worth porting to a GDExtension plugin.
post_draw_viewport
now returns a vector that results in the render buffers being presented on screen instead of drawing directly on screen, this is due to Vulkan doing the actual drawing of things later. For ARKit it should return a single entry that just tells the render engine to draw the contents of the render buffer as a full screen blit.
tracking_state
is a member value of the interface implementation, you can implement this whatever way is appropriate for ARKit. It's get_tracking_status
that is important and that function returning the correct value.
Mesh has indeed been removed from the tracker system. I had always planned to redesign this as things radically changed in interfaces like OpenXR but as there still aren't standardized APIs to access mesh data this has not been completed.
For ARKit it would probably make sense to create separate resources for this as part of the module. So a ARKitAnchorMesh
class for instance where you set the anchor ID and it return a (cached) mesh for that anchor.
Struggling to build gamecenter plugin for Godot 4.
Commands I have run
godot-ios-plugins: scons target=release_debug arch=arm64 simulator=no plugin=gamecenter version=4.0
./scripts/generate_static_library.sh gamecenter release_debug 4.0
I have successfully managed to compile inappstore in the same way (With the addition of running ./scripts/generate_xcframework.sh after) but it seems GameCenter specifically is giving me trouble?
@nicoformaggio did you find a workaround? I just made a separate issue for the same error before noticing you posted that here too: https://github.com/godotengine/godot-ios-plugins/issues/56
i will be done with the g4 plugn for iap ios by end of year.
Hey everyone, sorry for this off topic discussion , i am trying to implement ios app plugins by myself and facing an issue. I have opened an issue with this repo over here. Please help if you know anything about this
i will be done with the g4 plugn for iap ios by end of year.
Do you have any advice on how to start making iOS plugins for Godot? I don't have experience coding in Objective C. I come from Android. I would love to help the community by making more integrations. But I can't even find documentation on the internet for a lot of the classes and functions used for these plugins. And is iOS allowing for making Swift libraries that can work with Godot? Or are libraries still required to be in Objective C?
I'm having a go at getting ARKIt to run based on the work by @snowdaw:
post_draw_viewport
now returns a vector that results in the render buffers being presented on screen instead of drawing directly on screen, this is due to Vulkan doing the actual drawing of things later. For ARKit it should return a single entry that just tells the render engine to draw the contents of the render buffer as a full screen blit.
Vector<BlitToScreen> post_draw_viewport(RID p_render_target, const Rect2 &p_screen_rect) {
Vector<BlitToScreen> blit_to_screen;
BlitToScreen blit;
blit.render_target = p_render_target;
blit.multi_view.use_layer = true;
blit.lens_distortion.apply = false;
blit.dst_rect = p_screen_rect;
blit.multi_view.layer = 0;
blit_to_screen.push_back(blit);
return blit_to_screen;
}
tracking_state
is a member value of the interface implementation, you can implement this whatever way is appropriate for ARKit. It'sget_tracking_status
that is important and that function returning the correct value.
XRInterface::TrackingStatus tracking_state;
XRInterface::TrackingStatus ARKitInterface::get_tracking_status() const {
return tracking_state;
}
- Mesh has indeed been removed from the tracker system. I had always planned to redesign this as things radically changed in interfaces like OpenXR but as there still aren't standardized APIs to access mesh data this has not been completed.
Commented out set_mesh
and got it to build.
Getting a hot pink texture when I use CameraTexture - not sure why the texture isn't being set yet.
Been fighting a bunch of CameraTexture bugs in Godot 4.2. Will update and send a PR if I get it working.
The compilation tutorial from README worked for me at Godot 4.1
/ $ git clone --recursive https://github.com/godotengine/godot-ios-plugins.git godotIOSPlugins4.1 /godotIOSPlugins4.1/godot/ $ git fetch /godotIOSPlugins4.1/godot/ $ git checkout 9704596 # commit from which my GodotEngine was build (4.1) /godotIOSPlugins4.1/godot/ $ scons platform=ios target=template_debug # ^C after headers was build /godotIOSPlugins4.1/ $ scons target=release_debug arch=arm64 simulator=no plugin=icloud version=4.0 /godotIOSPlugins4.1/ $ ./scripts/generate_static_library.sh icloud release_debug 4.0 /godotIOSPlugins4.1/ $ ./scripts/generate_xcframework.sh icloud release_debug 4.0
Compiled, tested and working on iPhone.
var icloud = Engine.get_singleton('ICloud') icloud.set_key_values({key: v})
This continues to work in 4.2.1.
What updates are actually needed to support Godot 4?
@brianpmaher Does this work on iOS simulator as well, i don't have a real device?
@pritish-thub I haven't tried it on a simulator, but give it a shot. I'd assume you just have to set simulator=yes
.
The compilation tutorial from README worked for me at Godot 4.1
/ $ git clone --recursive https://github.com/godotengine/godot-ios-plugins.git godotIOSPlugins4.1 /godotIOSPlugins4.1/godot/ $ git fetch /godotIOSPlugins4.1/godot/ $ git checkout 9704596 # commit from which my GodotEngine was build (4.1) /godotIOSPlugins4.1/godot/ $ scons platform=ios target=template_debug # ^C after headers was build /godotIOSPlugins4.1/ $ scons target=release_debug arch=arm64 simulator=no plugin=icloud version=4.0 /godotIOSPlugins4.1/ $ ./scripts/generate_static_library.sh icloud release_debug 4.0 /godotIOSPlugins4.1/ $ ./scripts/generate_xcframework.sh icloud release_debug 4.0
Compiled, tested and working on iPhone.
var icloud = Engine.get_singleton('ICloud') icloud.set_key_values({key: v})
This continues to work in 4.2.1.
What updates are actually needed to support Godot 4?
Tried this approach again with a few tweaks of my own
git clone --recursive https://github.com/godotengine/godot-ios-plugins.git godotIOSPlugins4.1
cd godotIOSPlugins4.1/godot/
/godotIOSPlugins4.1/godot/ $ git fetch
/godotIOSPlugins4.1/godot/ $ git checkout b09f793f5 # commit from 4.2.1
/godotIOSPlugins4.1/godot/ $ scons platform=ios target=template_release
cd ..
/godotIOSPlugins4.1/ $ scons target=release arch=arm64 simulator=no plugin=camera version=4.0
/godotIOSPlugins4.1/ $ ./scripts/generate_static_library.sh camera release 4.0
/godotIOSPlugins4.1/ $ ./scripts/generate_xcframework.sh camera release 4.0
To my surprise it compiled but the message Invalid plugin config file camera.gdip
shows up in the output window. The contents of the above file are
name="Camera"
binary="camera.xcframework"
initialization="register_camera_types"
deinitialization="unregister_camera_types"
[dependencies]
linked=[]
embedded=[]
system=["AVFoundation.framework"]
capabilities=[]
files=[]
[plist]
NSCameraUsageDescription="Device camera is used for some functionality"
Looking into https://docs.godotengine.org/en/4.2/tutorials/platform/ios/ios_plugin.html I don't understand what is wrong.
Xcode- 15.2 macOS- 14.2.1 iOS- 17.2 Godot- 4.2.1
To my surprise it compiled but the message Invalid plugin config file camera.gdip shows up in the output window. The contents of the above file are
I encountered that too and had to rename my binary camera.xcframework
to match the config file. The scripts generated a longer name with the platform and stuff included.
Actually, maybe that's a takeaway here. These scripts worked out of the box with that one exception that the xcframework file had to be renamed to match the config ^
Of course, I missed that! It worked.
Thank you.
UPDATE: if you use release
it crashes in XCode. Change to debug
to get the image from the camera.
This repository hasn't been updated for Godot 4 yet, as its maintainer @naithar is no longer available. There is no updated version I know of yet.
Is there a new maintainer for this repo?
Good question.
Also, can someone share a 4.2 compatible binary plugin please?
I'm looking for this and for ARCore plugin, but it's hard to find information.
The compilation tutorial from README worked for me at Godot 4.1
/ $ git clone --recursive https://github.com/godotengine/godot-ios-plugins.git godotIOSPlugins4.1 /godotIOSPlugins4.1/godot/ $ git fetch /godotIOSPlugins4.1/godot/ $ git checkout 9704596 # commit from which my GodotEngine was build (4.1) /godotIOSPlugins4.1/godot/ $ scons platform=ios target=template_debug # ^C after headers was build /godotIOSPlugins4.1/ $ scons target=release_debug arch=arm64 simulator=no plugin=icloud version=4.0 /godotIOSPlugins4.1/ $ ./scripts/generate_static_library.sh icloud release_debug 4.0 /godotIOSPlugins4.1/ $ ./scripts/generate_xcframework.sh icloud release_debug 4.0
Compiled, tested and working on iPhone.
var icloud = Engine.get_singleton('ICloud') icloud.set_key_values({key: v})
This continues to work in 4.2.1.
I used the same approach for plugin=gamecenter, but I get the error
Undefined symbols for architecture arm64: "D_METHODP(char const*, char const* const**, unsigned int)", referenced from: GameCenter::_bind_methods() in gamecenter-device.release_debug.a(game_center.o) "ClassDB::bind_methodfi(unsigned int, MethodBind*, bool, MethodDefinition const&, Variant const**, int)", referenced from: GameCenter::_bind_methods() in gamecenter-device.release_debug.a(game_center.o) ld: symbol(s) not found for architecture arm64
Do you have any suggestion?
@saletrak @brianpmaher @vanoak Hi, im sorry if my question makes no sense i am a total beginner i followed these steps but im not sure what to do next in my game directory i have the folder ios/plugins/inappstore which files do i transfer from godotIOSPlugins4.1 ?
/ $ git clone --recursive https://github.com/godotengine/godot-ios-plugins.git godotIOSPlugins4.1
/godotIOSPlugins4.1/godot/ $ git fetch
/godotIOSPlugins4.1/godot/ $ git checkout 9704596 # commit from which my GodotEngine was build (4.1)
/godotIOSPlugins4.1/godot/ $ scons platform=ios target=template_debug # ^C after headers was build
/godotIOSPlugins4.1/ $ scons target=release_debug arch=arm64 simulator=no plugin=inappstore version=4.0
/godotIOSPlugins4.1/ $ ./scripts/generate_static_library.sh inappstore release_debug 4.0
/godotIOSPlugins4.1/ $ ./scripts/generate_xcframework.sh inappstore release_debug 4.0
@mobiusstrip After compilation only these file are important and need to be in project directory:
~/<project>/ios/plugins/icloud $ ls -la
drwxr-xr-x 12 jakub staff 384 21 lip 2023 bin
-rw-r--r--@ 1 jakub staff 236 21 lip 2023 icloud.gdip
~/<project>/ios/plugins/icloud $ ls -la bin
-rw-r--r-- 1 jakub staff 0 21 lip 2023 dummy
-rw-r--r-- 1 jakub staff 201248 21 lip 2023 icloud-device.release_debug.a
-rw-r--r-- 1 jakub staff 194544 21 lip 2023 icloud-simulator.release_debug.a
-rw-r--r-- 1 jakub staff 293920 21 lip 2023 icloud.release_debug.a
drwxr-xr-x 6 jakub staff 192 21 lip 2023 icloud.release_debug.xcframework
-rw-r--r-- 1 jakub staff 103024 21 lip 2023 libicloud.arm64-ios.release_debug.a
-rw-r--r-- 1 jakub staff 101848 21 lip 2023 libicloud.arm64-simulator.release_debug.a
-rw-r--r-- 1 jakub staff 98176 21 lip 2023 libicloud.armv7-ios.release_debug.a
-rw-r--r-- 1 jakub staff 92648 21 lip 2023 libicloud.x86_64-simulator.release_debug.a
Check file .gdip
, if is there a valid path to .xcframework
file.
In my case there is binary="bin/icloud.release_debug.xcframework"
.
After this you should be able to switch on your plugin in export options (ios ofc).
@saletrak thank you so much! it works could you also take a look at my code please i am trying to setup purchases and i feel like i'm missing something 😟
on ui
func _on_buy_button_10_shards_pressed():
Purchase.purchase("com.prism.spire.shards.ten","Shards 10")
new_shard_value=GameDataManager.level_info[0]["shards"]+10
GameDataManager.modify_dict(0,"shards",new_shard_value)
on purchase singleton
extends Node2D
signal purchase_confirmed
var _appstore = null
func check_events():
while _appstore.get_pending_event_count() > 0:
var event = _appstore.pop_pending_event()
if event.result=="ok": # other possible values are "progress", "error", "unhandled", "completed"
match event.type:
'product_info':
# fields: titles, descriptions, prices, ids, localized_prices, currency_codes, invalid_ids
pass
'purchase':
# fields: product_id, transaction_id, receipt
pass
'restore':
# fields: product_id, transaction_id, receipt
pass
'completed':
# Now the last in-app purchase restore has been sent,
# so if you didn't get any, the user doesn't have
# any purchases to restore.
pass
func purchase(product_id,reference_name):
var result = _appstore.purchase({str(product_id): str(reference_name)})
func restore(): # such button is required by Apple for non-consumable products
var result = _appstore.restore_purchases()
func _ready():
if Engine.has_singleton("InAppStore"):
_appstore = Engine.get_singleton('InAppStore')
else:
print("no app store plugin")
var result = _appstore.request_product_info( { "product_ids": ["com.prism.spire.shards.ten", "com.prism.spire.shards.hundred", "com.prism.spire.shards.onethousand", "com.prism.spire.shards.twohundredfifty", "com.prism.spire.shards.fifty", "com.prism.spire.shards.fivehundred"] } )
if result == OK:
print("Successfully started product info request")
_appstore.set_auto_finish_transaction(true)
var timer = Timer.new()
timer.wait_time = 1
# timer.connect("timeout", self, 'check_events')
await get_tree().create_timer(check_events()).timeout
add_child(timer)
timer.start()
else:
print("failed requesting product info")
I am trying to learn how to create iOS
plugin for Godot Game engine
. I downloaded the Godot
source code from Github and ran scons platform=ios target=template_debug -j4
to generate ios headers. Then i created a static library using Xcode and copied
flashlight_module.mm
, flashlight.h
, flashlight.gdip
, flashlight.mm
, flashlight_module.h
from Godot FlashLight repo
I also went to Header Search Path in Build Settings and added this path /Users/Desktop/godot/platform/ios
. Now when i try to build the project i get error saying 'core/engine.h' file not found
Now i tried creating an xcframework as well using Xcode
and copied all the files and set the Header Search Path and with that approach i get ton of errors.
What am i missing?
I resolved it by using this
Anyone has experience of of integrating swift with objective-c++. I have created a simple static library. I have experience of integrating swift in objective-c++, I have done it for react-native. Here is a sample video on that. but as soon as I run scons target=release_debug arch=arm64 plugin=arithematic version=4.0
I get error saying
arithematic/arithematic.mm:10:9:{10:9-10:30}: fatal error: 'arithematic-Swift.h' file not found [1]
#import "arithematic-Swift.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
scons: *** [arithematic/arithematic.o] Error 1
scons: building terminated because of errors.
Everything looks fine in Build Settings
Here is the source code
Has there been any confirmation that this might be looked at in the near future?
If I had known this was the case 3 weeks ago I'd of never touched Godot. I've personally lost $XXk to IAP failures from hacked together iOS IAP functionality.
Anybody know of a paid plugin even?
@1scriptz You can have a look at RevenueCat. They don't provide a direct plugin for Godot but they do it for iOS. You can create your own plugin using this and integrate RevenueCat
@BraveEvidence RevenueCat asks for 1% of Monthly Revenue and/or $1,700/month.
Has there been any confirmation that this might be looked at in the near future?
If I had known this was the case 3 weeks ago I'd of never touched Godot. I've personally lost $XXk to IAP failures from hacked together iOS IAP functionality.
Anybody know of a paid plugin even?
I made my own solution using SwiftGodot, I made it available here. It's not a finished product but it might work better for you
Are there any people who are trying to make it work for Godot 4?
@owlnewworlds You can check this
@owlnewworlds You can check this
Don't know who thumbed you down but thank you I'll give it a try!
Hello 👋 Thank you for your amazing work on these plugins!
Just a simple question, I can't find the answer in the documentation: Are the plugins updated for Godot 4? If not, were can I find an updated version, if any?