Iakobs / godot-play-game-services

A Godot 4.2 plugin for integration with Google Play Game Services
MIT License
82 stars 5 forks source link

android_plugin always null #29

Closed Shahar-Galukman closed 2 months ago

Shahar-Galukman commented 2 months ago

First of all, Kudos on all the effort and knowledge you share!

I'm having trouble integrating the plugin in an existing game.

What has been done so far...:

  1. Extracted addons in root folder
  2. Enabled plugin under Project Settings
  3. All autoload files got auto loaded automatically
  4. Adjusted manifest as guided in the Youtube video

GodotPlayGameServices.android_plugin remain null even though attempts providing the plugin.

I've attempted copying GodotPlayGameServices/bin/release/GodotPlayGameServices-release.aar to project_root/android/plugins and still no go, the android_plugin remain null.

The call to signin is made via a different autoload script which is located last in the order (I'm unsure if autoload order matter, but if it is I'd assume having my using script last should be good enough)

I'm using Mac OS m1 if it might be related (not too sure it is).

Would appreciate your aid

Iakobs commented 2 months ago

Hi @Shahar-Galukman thanks a lot for your kind words!

I'm a bit confused with your problem, though. What youtube video do you refer to? This plugin has an in-editor screen to put your game id from Google so you don't have to mess with the manifest at all. Can you check that again, just to be sure that you refer to the proper plugin? The version of the plugin for Godot 3.x needs messing with manifest, but not this one.

I also don't know if working on a Mac is problematic. I haven't tested there, but I don't think this should be an issue.

Please let me know if you can follow all the steps in the readme and your problem persists. Also, there's a second readme in the demo folder, with common troubleshooting and small examples on how the demo project is using the plugin.

Thanks again for your interest in the plugin!

Shahar-Galukman commented 2 months ago

Thank you kindly for the quick response, indeed my initial post was bit messy so I took your suggestion and had another attempt. Sadly yet managed to succeed.

Before my attempt I removed android and addons folder and started all over (as well ensured to remove autoloaded plugin files in Godot's autoload tab)

I'm using this plugin, for Godot 4.2. Here are now the steps I took;

  1. Downloaded https://github.com/Iakobs/godot-play-game-services/releases/tag/v1.7.0 addons.zip

  2. Extracted the zip to Godot project's root (res://addons)

    image
  3. I've then enabled the plugin as expected

    image
  4. All the plugin autoload files got added to Autoload successfully.

  5. I've submitted my game id as mentioned

    image
  6. I've installed the andoird template and turned on "Use Gradle Build"

  7. When I try to run the SignInClient.sign_in() method in the _ready of my game's main scene I get to no plugin found err:

    image

I hope this makes my usage more clear and perhaps aid in better understand the issue I tackle. I do feel like I miss something plain though significant (isn't it always the case ;))

I tried backward engineer the source of android_plugin variable definition though coulnd't easily from Godot, therefore I assume it gets loaded somehow from the Kotlin projects build. (less familiar yet with that area in the code).

Iakobs commented 2 months ago

Hi @Shahar-Galukman

This is very helpful! It looks like you are doing everything as it is supposed to be done, so it's very strange. I have one more question, though, how do you run the project? If the project is not run in an android device (let it be real or emulated), the plugin doesn't load at all.

Lastly, if you are using an android device, then it would be very helpful if you can provide a Minimum Reproducible Project in a zip file, as a comment here. I have access to a mac, even though it's not an m1, so I can try it there.

Let's see if we can solve this!

EDIT: Also, I don't know if you are familiar with android development, but if you could check the android logs for any error, that would also be very helpful. Let me know if you need help with this too, I can try to summarize the process :)

Shahar-Galukman commented 2 months ago

"If the project is not run in an android device (let it be real or emulated), the plugin doesn't load at all." Ohh my, was not aware of it, indeed was not running via an android device nor emulator.

A rookie mistake it is then, pardon the trouble.

Keep being awesome, I really do learn a lot from you and appreciate all of your contribution to this amazing community.

I'll now close the ticket, blushing in the corner.

Iakobs commented 2 months ago

No worries at all, @Shahar-Galukman !! I'm actually realising that I never stated that in the docs like in any obvious place, it's just mentioned briefly in a line, so I will add a warning somewhere to make it more evident.

Thanks for pointing out this issue!

Shahar-Galukman commented 2 months ago
image

Rejoice :)

Iakobs commented 2 months ago

yay! so glad it works now!