godot-sdk-integrations / godot-ios-plugins

MIT License
139 stars 54 forks source link

Add more than one binary at the same time #6

Closed gumaciel closed 3 years ago

gumaciel commented 3 years ago

I am currently developing a Plugin with AdMob in which I need in addition to exporting the plugin I created, I also need to export these .xcframework to be able to work

Captura de Tela 2021-04-08 às 00 07 29

This could work:

[config]
name="MyPlugin"
binary="MyPlugin.a"

Change to array:

[config]
name="MyPlugin"
binary=["MyPlugin.a", "OtherBinary.a"]
gumaciel commented 3 years ago

I created another "plugin" only with the .xcframework and works.

Captura de Tela 2021-04-08 às 00 12 24

But i won't do that because when export the Project will need to enable all plugins: Captura de Tela 2021-04-08 às 00 13 56

And i want only one plugin that have more than one binary (which are dependencies), not a lot of Plugins

Also works when add the .xcframework manually, but i want to do this automatically.

naithar commented 3 years ago

dependencies section and linked/embedded field should actually help with copying third party dependency frameworks to the Xcode projects.

[dependencies]
linked = ["nanopb.xcframework", "PromiceObjC.xcframework"]

I think I've mentioned it here, but without an example: https://github.com/Poing-Studios/Godot-AdMob-Android-iOS/issues/27#issuecomment-761749140

gumaciel commented 3 years ago

Everything works, but this framework "PromisesObjC.xcframework" always gives error, do you know why?

Captura de Tela 2021-04-08 às 10 07 16

Captura de Tela 2021-04-08 às 10 08 03

gumaciel commented 3 years ago

Captura de Tela 2021-04-08 às 10 10 26

gumaciel commented 3 years ago

You can check the SDK that i am using here: https://dl.google.com/googleadmobadssdk/googlemobileadssdkios.zip

naithar commented 3 years ago

https://github.com/naithar/godot/blob/576f0f14b224a0086675dd5da5a5c1a66856e111/platform/iphone/export/export.cpp#L1337-L1347 This lines are responsible for dependencies handling. I haven't tested them with xcframeworks, since at that time xcframework wasn't even supported, so there might be some problem with it. But I'm also not sure about the path that gets copied - PromiseObjC.framework/Headers/Headers doesn't seem correct to me. Seems like the problem might be related to it.

naithar commented 3 years ago

@gustavottc Yeah the file (or simlink, I'm not sure) at PromiseObjC.framework/Headers/Headers path seems to be corrupted. Can you delete it and check if it'll work for you?

Edit:

ls -al /.../GoogleMobileAdsSdkiOS-8.3.0/PromisesObjC.xcframework/macos-arm64_x86_64/PromisesObjC.framework/Headers/Headers
lrwxr-xr-x  1 naithar  staff  18  8 апр 17:20 /.../GoogleMobileAdsSdkiOS-8.3.0/PromisesObjC.xcframework/macos-arm64_x86_64/PromisesObjC.framework/Headers/Headers -> Versions/A/Headers

There is no Versions/A/Headers directory, so I guess that's the problem.

gumaciel commented 3 years ago

@naithar Ty so much, when i delete this file worked!

As i see this was a simlimk i will contact Google to try to fix this on next version.