0

Please can someone assist in getting the https://github.com/cgisca/PGSGP module working for Godot 3.2.2.stable.official.

I followed the instructions on the README.md.

I've had to add:

[android]
modules="org/godotengine/godot/PlayGameServices"

in my project.godot file and restart my editor.

I also added the following permissions:

  • Internet
  • Access Network State

When I don't set my app_id in res/values/ids.xml, I get sign in error 10.

When I do enter it it crashes my app, and adb logcat -s godot prints the following:

--------- beginning of crash
--------- beginning of main
--------- beginning of system
07-04 08:29:49.586   602   758 I godot   : Loading Android module: org/godotengine/godot/PlayGameServices
07-04 08:29:49.586   602   758 E godot   : **ERROR**: Couldn't find singleton for class: org/godotengine/godot/PlayGameServices.
07-04 08:29:49.586   602   758 E godot   :    At: platform/android/java_godot_lib_jni.cpp:104:_initialize_java_modules() - Condition "!singletonClass" is true. Continuing.

Some additional info:

  • I do not have any other plugins/modules installed, so did not have to remove gms.version.
  • My Directory structure:
- myproject
  - android
    - build
    - android-pgs-plugin
      - AndroidManifest.conf
      - gradle.conf
      - res
      - src
    
  • My code in globals.gd (autoloaded script)
var play_games

func init_play_games():
    if Engine.has_singleton("PlayGameServices"):
        print("Initialising Play Game Services")
        play_games = Engine.get_singleton("PlayGameServices")
        var show_popups = true
        var enable_save_games = false 
        play_games.init(get_instance_id(), show_popups, enable_save_games)
    else:
        print("Play games module not found")
        
func _on_sign_in_success(account_id: String) -> void:
    print("Sign In Success", account_id)
  
func _on_sign_in_failed(error_code: int) -> void:
    print("Sign in failed", error_code)
  • MainMenu.gd:
func _ready():
    globals.init_play_games()
    globals.play_games.sign_in()

1 Answers1

0

I managed to get it working, by deleting android/build and then running Project Install Android Build Template again.