godotengine / godot-ios-plugins

MIT License
126 stars 48 forks source link

Plugins don't work with Godot 3.5 (but they do with Godot 3.4.5) #37

Open joshnajera opened 1 year ago

joshnajera commented 1 year ago

I cannot get this to work. I've tried this while checking out branch 3.5 and 3.4. went into godot-ios-plugins/godot/ ran scons command backed out into godot-ios-plugins/ ran the other scons command ran the other two scripts genereate_static_library.sh and generate_xcframework.sh I see the output files in bin, i've tried moving them into godotProjectName/ios/plugins/

The plugin doesn't appear in godot. I don't know where I am going wrong and haven't been able to find help elsewhere, so sorry if this is the wrong place.

michael-garofalo commented 1 year ago

I think that's a good question… does this work with 3.5? 🤷🏻‍♂️

Also, I just learned that SCons is part of the install process, but that requires Python, and Python is no longer included with macOS.

Somewhat minor issues, and I'm still learning about Godot, but this seems like it could be easier. When I see the word plugin, I think of something like WordPress. That's just a one-click install, or a simple drag-and-drop of a folder. I wasn't expecting to be using Git, SCon, and Python. I'm not sure how to simplify that, but that's what I was looking to do while learning about this repo. 🤔

Did you ever get it working?

Calinou commented 1 year ago

Somewhat minor issues, and I'm still learning about Godot, but this seems like it could be easier. When I see the word plugin, I think of something like WordPress. That's just a one-click install, or a simple drag-and-drop of a folder. I wasn't expecting to be using Git, SCon, and Python. I'm not sure how to simplify that, but that's what I was looking to do while learning about this repo.

Plugins are native code, so they need to be compiled along with the iOS application to work. There's no way around that in an OS that doesn't allow dynamic linking (not without big caveats at least).

joshnajera commented 1 year ago

Did you ever get it working?

Not through compilation. I'm assuming the problem is that the compilation doesn't create the required .gdip config file? And I don't know how to progress.

Although I have discovered there exists a pre-compiled version under the releases section, a zip file called "plugins_master" has them. I created a folder called "ios" in my project folder, and copied the "plugins" folder from the zip. resulting in res://ios/plugins/... You will see them appear under project > export > iOS > Options > Plugins. I'm using godot 3.4.5 stable, and on macOS and it works and tested on iPhone. Be aware, you will need to be a paid apple developer account to get these to work or else you will probably just get errors when trying to use them.

michael-garofalo commented 1 year ago

Nice! 🙂 So there is an easier way to do this!

I tried it out with Godot 3.5 and it did not work. It just shows a Godot splash screen. I tried Godot 3.4.5 and it worked. Although, heh, it seems I have a lot more work to actually make it working. The tree was upside-down and moving in the opposite direction.

naithar commented 1 year ago

@joshnajera if you are using generate_xcframework.sh script you have to manually copy .gdip file from plugin folder. release_xcframework.sh will create ready to use plugins, which you can just copy into Godot project. Precompiled plugins for 3.5: https://github.com/godotengine/godot-ios-plugins/releases/tag/3.5-stable.

michael-garofalo commented 1 year ago

I tried doing some troubleshooting, to see why this doesn't work with 3.5.

First Attempt — Since it froze at splash screen, I tried turning that off. It still freezes.

Second Attempt — I tried comparing the logs. It seems identical, except for one thing. The order is different when registering the camera.

3.4.5 says…

Activate ARKit 2022-09-06 07:42:35.594520-0400 ar[53541:2599611] Starting ARKit session Starting ARKit session

  • Camera padding l:0 r:0 t:0 b:0
  • Camera Y plane size: 1920, 1440 - 1920
  • Camera CbCr plane size: 960, 720 - 1920 2022-09-06 07:42:36.321815-0400 ar[53541:2599840] Registered camera Back Camera with id 1 position 2 at index 1 Registered camera Back Camera with id 1 position 2 at index 1 2022-09-06 07:42:36.322459-0400 ar[53541:2599840] Registered camera Front Camera with id 2 position 1 at index 2 Registered camera Front Camera with id 2 position 1 at index 2

3.5 says…

Activate ARKit 2022-09-06 07:35:51.852897-0400 ar[53480:2594490] Starting ARKit session Starting ARKit session 2022-09-06 07:35:53.282904-0400 ar[53480:2594799] Registered camera Back Camera with id 1 position 2 at index 1 Registered camera Back Camera with id 1 position 2 at index 1 2022-09-06 07:35:53.283183-0400 ar[53480:2594799] Registered camera Front Camera with id 2 position 1 at index 2 Registered camera Front Camera with id 2 position 1 at index 2

  • Camera padding l:0 r:0 t:0 b:0
  • Camera Y plane size: 1920, 1440 - 1920
  • Camera CbCr plane size: 960, 720 - 1920

I'm not sure if that matters, but that was the main difference that I saw in the logs.

3 4 5-vs-3 5

joshnajera commented 1 year ago

@joshnajera if you are using generate_xcframework.sh script you have to manually copy .gdip file from plugin folder. @naithar thanks! Good to know, I will remember that for next time. :)

michael-garofalo commented 1 year ago

@Calinou — It looks like there was a new release of the iOS plugins. I tested it out and I was able to get an Augmented Reality test working.

Although, now the splash screen is always there, regardless of which setting is picked for “project settings > boot splash”. It's also at the wrong orientation. As an example, if the phone is held in portrait, it displays as upside-down landscape.

naithar commented 1 year ago

@Calinou — It looks like there was a new release of the iOS plugins. I tested it out and I was able to get an Augmented Reality test working.

Although, now the splash screen is always there, regardless of which setting is picked for “project settings > boot splash”. It's also at the wrong orientation. As an example, if the phone is held in portrait, it displays as upside-down landscape.

iOS will always show boot splash, there is no way around that - it is shown while application is preparing for launch and loading resources. You can manually change storyboard or boot images (which one is used depends on your Godot export settings) in Xcode project to display black screen, while application is starting.

michael-garofalo commented 1 year ago

In general, I was able to create some iOS / macOS apps without a splash screen. Apple does want it, but my apps loaded fast enough that it still passed review. Here, Godot does need a splash screen because there is a startup. A splash screen is a good idea because it risks rejection without it.

I'm just saying that I noticed something different between the two versions. I don't think it's a setting change that I made, but I can't rule that out 100%, as I'm still getting used to Godot. Editing the splash screens in Xcode does seem a good idea. I wasn't sure where they were at first, but I found them…

Screen Shot 2022-09-07 at 6 52 40 AM

That's where you can see the problem. The Godot logo is not matching the screenshot orientation. It's a minor problem, but it's something that I noticed. Perhaps this is not the best place to mention it. Maybe that's a core bug? 🤔

I also just realized that I can add portrait and landscape launch screens in Godot, so that's nice. (I haven't tried it yet though.)

Also, I just tested ARKit with Godot 3.5.1 (RC 1) and it worked.

naithar commented 1 year ago

@michael-garofalo seems like generated splash images are using incorrect orientation in portrait mode. Does Godot iOS export produce same rotated images on 3.5.1? You should report this issue on Godot repo if it does.

You can also use a Storyboard option, it's a newer and preffered option for new iOS projects and should give you less trouble. It will create a LaunchScreen.storyboard file in exported Xcode project. You can then modify it the way you want.

michael-garofalo commented 1 year ago

https://github.com/godotengine/godot/issues/65470

djrain commented 1 year ago

I can't seem to get Godot to recognize the plugin in 3.5.2.

I downloaded the release zips for 3.5 and moved inappstore.gdip and inappstore-device.release.a into res://ios/plugins. But Godot keeps showing in output "Invalid plugin config file inappstore.gdip"

NianoTT commented 1 year ago

I can't seem to get Godot to recognize the plugin in 3.5.2.

I downloaded the release zips for 3.5 and moved inappstore.gdip and inappstore-device.release.a into res://ios/plugins. But Godot keeps showing in output "Invalid plugin config file inappstore.gdip"

Sounds like you got the file structure wrong. From the zip file, move the entire "inappstore" folder to ios/plugins, so you end up with ios/plugins/inappstore/[gdip file and 2 folders with content]

djrain commented 1 year ago

From the zip file, move the entire "inappstore" folder to ios/plugins, so you end up with ios/plugins/inappstore/[gdip file and 2 folders with content]

Hm, If I do that, I no longer get the plugin error message, but it still doesn't show up in export settings.

NianoTT commented 1 year ago

It should be between the "Application" and "Capabilities", you have to scroll down a bit, a new segment "Plugins".

djrain commented 1 year ago

It should be between the "Application" and "Capabilities", you have to scroll down a bit, a new segment "Plugins".

Yeah, only my request review plugin is there. No IAP

EDIT: jk, just my silly mistake. Shows up now as expected.