Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update for Godot 4 #47

Open
AdrKacz opened this issue May 15, 2023 · 49 comments
Open

Update for Godot 4 #47

AdrKacz opened this issue May 15, 2023 · 49 comments

Comments

@AdrKacz
Copy link

AdrKacz commented May 15, 2023

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?

@Calinou
Copy link
Contributor

Calinou commented May 15, 2023

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.

@Calinou Calinou changed the title ❓Does it supports Godot 4 Update for Godot 4 May 15, 2023
@Calinou Calinou pinned this issue May 15, 2023
@AdrKacz
Copy link
Author

AdrKacz commented May 15, 2023

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-?

@ghostbutter-games
Copy link

ghostbutter-games commented May 17, 2023

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:

  • Follow the instructions from the README.md, but set the submodule godot repo to your desired Godot 4.0.X version, then build the headers and build the static library as per instructions.

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.

@saletrak
Copy link

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})

@HouWan
Copy link

HouWan commented Aug 8, 2023

@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:

  • Xcode 14.3.1 (14E300c)
  • godot-4.1.1-stable

@saletrak
Copy link

saletrak commented Aug 8, 2023

@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:

  • Xcode 14.2
  • Godot 4.1
  • iOS 16.2

Not sure does it metter.

@iusn
Copy link

iusn commented Aug 26, 2023

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

@NianoTT
Copy link

NianoTT commented Aug 26, 2023

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)

@iusn
Copy link

iusn commented Aug 27, 2023

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.

@NianoTT
Copy link

NianoTT commented Aug 27, 2023

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

@iusn
Copy link

iusn commented Aug 28, 2023

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

@phil-hudson
Copy link

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!

@saletrak
Copy link

saletrak commented Sep 5, 2023

@phil-hudson I add it manually to project in XCode, every time after project is exported. Did not found any other solution.

@phil-hudson
Copy link

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"]
    )

@iusn
Copy link

iusn commented Sep 7, 2023

@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

@Snowdaw
Copy link

Snowdaw commented Sep 28, 2023

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:

  • I don't know what this function should do and if a new blit should be created or it should be accessed as a variable that is defined somewhere else. Vector<BlitToScreen> post_draw_viewport(RID p_render_target, const Rect2 &p_screen_rect)
  • The variable tracking_state is unavailable. Which is defined in the mobile_vr_interface and openxr_interface.
  • Ability to set mesh on a 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.

@BastiaanOlij
Copy link

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.

@nicoformaggio
Copy link

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?

Compilation Log:
  scons: Reading SConscript files ...
  scons: done reading SConscript files.
  scons: Building targets ...
  scons: `bin/libgamecenter.arm64-ios.release_debug.a' is up to date.
  scons: done building targets.
  scons: Reading SConscript files ...
  scons: done reading SConscript files.
  scons: Building targets ...
  g++ -o plugins/gamecenter/game_center_module.o -c -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DVULKAN_ENABLED -std=gnu++17 -fno-aligned-allocation -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 armv7 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/platform/ios plugins/gamecenter/game_center_module.cpp
  g++ -o plugins/gamecenter/game_center.o -c -O2 -ftree-vectorize -DNDEBUG -DNS_BLOCK_ASSERTIONS=1 -DDEBUG_ENABLED -DVULKAN_ENABLED -std=gnu++17 -fno-aligned-allocation -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 armv7 -isysroot -stdlib=libc++ -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk -DPTRCALL_ENABLED -I. -Igodot -Igodot/platform/ios plugins/gamecenter/game_center.mm
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1105:25: error: use of undeclared identifier 'vzip1q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __r01 = vzip1q_f32(__x0, __x1);
                           ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1105:17:{1105:25-1105:47}: error: no viable conversion from 'float32x4x2_t' to 'simd_float4' (vector of 4 'float' values) [2]
       simd_float4 __r01 = vzip1q_f32(__x0, __x1);
                   ^       ~~~~~~~~~~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1120:25: error: use of undeclared identifier 'vzip1q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __r01 = vzip1q_f32(__x0, __x1);
                           ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1120:17:{1120:25-1120:47}: error: no viable conversion from 'float32x4x2_t' to 'simd_float4' (vector of 4 'float' values) [2]
       simd_float4 __r01 = vzip1q_f32(__x0, __x1);
                   ^       ~~~~~~~~~~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1121:25: error: use of undeclared identifier 'vzip2q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __r2x = vzip2q_f32(__x0, __x1);
                           ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1121:17:{1121:25-1121:47}: error: no viable conversion from 'float32x4x2_t' to 'simd_float4' (vector of 4 'float' values) [2]
       simd_float4 __r2x = vzip2q_f32(__x0, __x1);
                   ^       ~~~~~~~~~~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1134:25: error: use of undeclared identifier 'vzip1q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __r01 = vzip1q_f32(__x.columns[0], __x.columns[1]);
                           ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1134:17:{1134:25-1134:67}: error: no viable conversion from 'float32x4x2_t' to 'simd_float4' (vector of 4 'float' values) [2]
       simd_float4 __r01 = vzip1q_f32(__x.columns[0], __x.columns[1]);
                   ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1135:25: error: use of undeclared identifier 'vzip2q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __r23 = vzip2q_f32(__x.columns[0], __x.columns[1]);
                           ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1135:17:{1135:25-1135:67}: error: no viable conversion from 'float32x4x2_t' to 'simd_float4' (vector of 4 'float' values) [2]
       simd_float4 __r23 = vzip2q_f32(__x.columns[0], __x.columns[1]);
                   ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1154:24: error: use of undeclared identifier 'vzip1q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __t0 = vzip1q_f32(__x0,__x2);
                          ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1154:17:{1154:24-1154:45}: error: no viable conversion from 'float32x4x2_t' to 'simd_float4' (vector of 4 'float' values) [2]
       simd_float4 __t0 = vzip1q_f32(__x0,__x2);
                   ^      ~~~~~~~~~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1155:24: error: use of undeclared identifier 'vzip1q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __t1 = vzip1q_f32(__x1,padding);
                          ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1155:17:{1155:24-1155:48}: error: no viable conversion from 'float32x4x2_t' to 'simd_float4' (vector of 4 'float' values) [2]
       simd_float4 __t1 = vzip1q_f32(__x1,padding);
                   ^      ~~~~~~~~~~~~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1156:24: error: use of undeclared identifier 'vzip1q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __r0 = vzip1q_f32(__t0,__t1);
                          ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1156:17:{1156:24-1156:45}: error: no viable conversion from 'float32x4x2_t' to 'simd_float4' (vector of 4 'float' values) [2]
       simd_float4 __r0 = vzip1q_f32(__t0,__t1);
                   ^      ~~~~~~~~~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1157:24: error: use of undeclared identifier 'vzip2q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __r1 = vzip2q_f32(__t0,__t1);
                          ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'simd' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/simd.h:23:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1157:17:{1157:24-1157:45}: error: no viable conversion from 'float32x4x2_t' to 'simd_float4' (vector of 4 'float' values) [2]
       simd_float4 __r1 = vzip2q_f32(__t0,__t1);
                   ^      ~~~~~~~~~~~~~~~~~~~~~
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/usr/include/simd/matrix.h:1178:24: error: use of undeclared identifier 'vzip1q_f32'; did you mean 'vzipq_f32'? [2]
       simd_float4 __t0 = vzip1q_f32(__x0,__x2);
                          ^
  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/include/arm_neon.h:32079:20: note: 'vzipq_f32' declared here [2]
   __ai float32x4x2_t vzipq_f32(float32x4_t __p0, float32x4_t __p1) {
                      ^
  fatal error: too many errors emitted, stopping now [-ferror-limit=]
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  In file included from <module-includes>:1:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:3:9:{3:2-3:10}: fatal error: could not build module 'simd' [4]
   #import <simd/simd.h>
    ~~~~~~~^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'MetalKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:18:
  While building module 'ModelIO' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKModel.h:11:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ModelIO.framework/Headers/ModelIO.h:10:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ModelIO.framework/Headers/MDLAsset.h:10:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ModelIO.framework/Headers/MDLObject.h:9:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ModelIO.framework/Headers/MDLTypes.h:13:10:{13:2-13:11}: fatal error: could not build module 'simd' [4]
   #include <simd/simd.h>
    ~~~~~~~~^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'MetalKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:18:
  In file included from <module-includes>:2:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MetalKit.h:10:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/MetalKit.framework/Headers/MTKModel.h:11:9:{11:2-11:10}: fatal error: could not build module 'ModelIO' [4]
   #import <ModelIO/ModelIO.h>
    ~~~~~~~^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'SpriteKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:23:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SpriteKit.h:8:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SKScene.h:9:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SKEffectNode.h:19:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SKWarpGeometry.h:12:9:{12:2-12:10}: fatal error: could not build module 'simd' [4]
   #import <simd/simd.h>
    ~~~~~~~^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'SpriteKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:23:
  While building module 'GLKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/SpriteKit.framework/Headers/SKUniform.h:15:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GLKit.framework/Headers/GLKit.h:15:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GLKit.framework/Headers/GLKModel.h:7:9:{7:2-7:10}: fatal error: could not build module 'ModelIO' [4]
   #import <ModelIO/ModelIO.h>
    ~~~~~~~^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'SceneKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:24:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKit.h:14:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/SceneKit.framework/Headers/SceneKitTypes.h:10:9:{10:2-10:10}: fatal error: could not build module 'simd' [4]
   #import <simd/simd.h>
    ~~~~~~~^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'GameplayKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:27:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKit.h:10:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameplayKit.framework/Headers/GameplayKitBase.h:9:9:{9:2-9:10}: fatal error: could not build module 'simd' [4]
   #import <simd/simd.h>
    ~~~~~~~^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'ReplayKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:33:
  While building module 'AVFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ReplayKit.framework/Headers/RPBroadcastExtension.h:9:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFoundation.h:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVFCapture.h:20:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVDepthData.h:11:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCameraCalibrationData.h:12:9:{12:2-12:10}: fatal error: could not build module 'simd' [4]
   #import <simd/matrix_types.h>
    ~~~~~~~^
  While building module 'GameKit' imported from plugins/gamecenter/game_center_delegate.h:31:
  While building module 'ReplayKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/GameKit.framework/Headers/GameKit.h:33:
  In file included from <module-includes>:1:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ReplayKit.framework/Headers/ReplayKit.h:17:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ReplayKit.framework/Headers/RPScreenRecorder.h:22:
  /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.0.sdk/System/Library/Frameworks/ReplayKit.framework/Headers/RPBroadcastExtension.h:9:9:{9:2-9:10}: fatal error: could not build module 'AVFoundation' [4]
   #import <AVFoundation/AVFoundation.h>
    ~~~~~~~^
  In file included from plugins/gamecenter/game_center.mm:33:
  plugins/gamecenter/game_center_delegate.h:31:9:{31:2-31:10}: fatal error: could not build module 'GameKit' [4]
   #import <GameKit/GameKit.h>
    ~~~~~~~^
  30 errors generated.
  scons: *** [plugins/gamecenter/game_center.o] Error 1
  scons: building terminated because of errors.
  
  ````
  
</details>




@sourencho
Copy link

@nicoformaggio did you find a workaround? I just made a separate issue for the same error before noticing you posted that here too: #56

@djordjije
Copy link

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?

@bnolan
Copy link

bnolan commented Jan 4, 2024

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's get_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.

@bnolan
Copy link

bnolan commented Jan 5, 2024

Getting a hot pink texture when I use CameraTexture - not sure why the texture isn't being set yet.

@bnolan
Copy link

bnolan commented Jan 5, 2024

Been fighting a bunch of CameraTexture bugs in Godot 4.2. Will update and send a PR if I get it working.

@myselfuser1
Copy link

I have been doing a lot of Godot 4 Plugins for android, check here and if you're interested InAppPurchases check here

@brianpmaher
Copy link

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?

@myselfuser1
Copy link

@brianpmaher Does this work on iOS simulator as well, i don't have a real device?

@brianpmaher
Copy link

@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.

@vanoak
Copy link

vanoak commented Jan 11, 2024

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

@brianpmaher
Copy link

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.

@brianpmaher
Copy link

brianpmaher commented Jan 11, 2024

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 ^

@vanoak
Copy link

vanoak commented Jan 11, 2024

Of course, I missed that!
It worked.

Thank you.

UPDATE: if you use release it crashes in XCode. Change to debugto get the image from the camera.

@brianpmaher
Copy link

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?

@juangea
Copy link

juangea commented Jan 14, 2024

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.

@ivanfemia
Copy link

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?

@mobiusstrip
Copy link

mobiusstrip commented Feb 26, 2024

@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

@saletrak
Copy link

@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).

@mobiusstrip
Copy link

@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")

@BraveEvidence
Copy link

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?

@BraveEvidence
Copy link

I resolved it by using this

@BraveEvidence
Copy link

BraveEvidence commented May 6, 2024

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
327937984-864b3eb9-87c7-45e7-8373-d96fd08f9d30

Here is the source code

@1scriptz
Copy link

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?

@BraveEvidence
Copy link

@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

@1scriptz
Copy link

@BraveEvidence RevenueCat asks for 1% of Monthly Revenue and/or $1,700/month.

@rktprof
Copy link

rktprof commented Jun 24, 2024

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

@owlnewworlds
Copy link

Are there any people who are trying to make it work for Godot 4?

@myselfuser1
Copy link

@owlnewworlds You can check this

@owlnewworlds
Copy link

@owlnewworlds You can check this

Don't know who thumbed you down but thank you I'll give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests