Android Play Games Services plugin for Godot Game Engine

Overview
Comments
  • uses-sdk:minSdkVersion 19 cannot be smaller than version 21

    uses-sdk:minSdkVersion 19 cannot be smaller than version 21

    Hi dears,

    Congrats for the PGSGP, the community has long been waiting for a well mainteined Google Play Games services! <3

    After update to 3.4.1 I'm getting a strange error:

    > Task :processDebugMainManifest FAILED
    /home/*****/android/build/src/debug/AndroidManifest.xml Error:
    	uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [GodotPlayGamesServices.release.aar] /home/mex/.gradle/caches/transforms-3/970b45490a2361ae4cfd178ef1ac003f/transformed/jetified-GodotPlayGamesServices.release/AndroidManifest.xml as the library might be using APIs not available in 19
    	Suggestion: use a compatible library with a minSdk of at most 19,
    		or increase this project's minSdk version to at least 21,
    		or use tools:overrideLibrary="io.cgisca.godot.gpgs" to force usage (may lead to runtime failures)
    
    See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
    
    
    FAILURE: Build failed with an exception.
    

    On the last version I set SDK version to 21 on android/build/config.gradle, but now I can't understand what is happening, because SDK version 21 is set on config.gradle, but Godot is erroring android/build/src/debug/AndroidManifest.xml but this file don't have any SDK version reference.

    Could you please kindly help me to solve this issue?

    opened by marcio-pessoa 6
  • token missing in signIn callback

    token missing in signIn callback

    Hi, I was hoping to use this plugin to authenticate with my backend. The documentation says that a "User token for backend use" is returned in the sign in callback. However, this attribute is missing for me.

    opened by smarwei 4
  • Stack Trace on Login on Godot 3.4.2

    Stack Trace on Login on Godot 3.4.2

    Hey! Im using this addon and everytime I try to login I get a stack trace saying its expecting an interface and got a class

    12-29 12:00:31.036 19327 19327 D AndroidRuntime: Shutting down VM
    12-29 12:00:31.037 19327 19327 E AndroidRuntime: FATAL EXCEPTION: main
    12-29 12:00:31.037 19327 19327 E AndroidRuntime: Process: org.finepointcgi.gspp, PID: 19327
    12-29 12:00:31.037 19327 19327 E AndroidRuntime: java.lang.IncompatibleClassChangeError: Found class com.google.android.gms.games.GamesClient, but interface was expected (declaration of 'com.google.android.gms.games.GamesClient' appears in /data/app/~~wB3kvUyirHWGIFARPNOpTQ==/org.finepointcgi.gspp-sTsf8cvrH5c50A2Gb7rwoA==/base.apk)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at io.cgisca.godot.gpgs.signin.SignInController.enablePopUps(SignInController.kt:104)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at io.cgisca.godot.gpgs.signin.SignInController.access$enablePopUps(SignInController.kt:12)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at io.cgisca.godot.gpgs.signin.SignInController$signIn$1.onComplete(SignInController.kt:52)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at com.google.android.gms.tasks.zzj.run(Unknown Source:4)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:938)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:99)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:201)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7842)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    12-29 12:00:31.037 19327 19327 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
    

    I do end up getting my login in so the code itself seems to work however it always crashes on me or I get an error 10 depending on how the codes mood is.

    Im using Godot 3.4 with Java 11

    opened by finepointcgi 4
  • Link back to the original creator

    Link back to the original creator

    Hi Kristijan Draca, we noticed that you have forked Constantin Gisca's public MIT licensed repository, and removed the backlink to the original github sources.

    Let's add a backlink there, and perhaps pull your changes to the main repository?

    opened by tavurth 2
  • Game crash when signed in

    Game crash when signed in

    Hello,

    I moved to Godot 3.4.4.
    I built the PGSGP for this new version following the instructions: https://github.com/cgisca/PGSGP#generate-plugin-aar-file, I set the APP_ID, etc.

    My game successfully connected once as the _on_sign_in_success() was correctly triggered (I had a print for debugging), but it immediately crashed once signed in.
    I relaunched the app but the callback wasn't triggered anymore (no print in the Godot console).
    If I comment the code related to the GodotPlayGamesServices my game run correctly.

    Do you have any idea of what could it be ?

    opened by Acwok 1
  • Game save and game loading failure callbacks pop twice; can't get saving to work

    Game save and game loading failure callbacks pop twice; can't get saving to work

    Hello! Managed to get signing in to work. However, when I try to save a snapshot like this:

    var data_to_save: Dictionary = {"Name" : "Johan"}
    play_services.saveSnapshot("RoadToMarsData", to_json(data_to_save), "Road to Mars progress data.")
    

    It fails. Game saves are enabled in my console, and I have tried wiping Google Play Services data on all my test devices.

    I also get load/save failure callbacks twice per each attempt to save or load.

    my adb logcat -s godot:

    01-17 13:10:00.287  5645  5692 I godot   : Godot Engine v3.4.2.stable.official.45eaa2daf - https://godotengine.org
    01-17 13:10:00.326  5645  5692 I godot   : OpenGL ES 3.0 Renderer: Adreno (TM) 540
    01-17 13:10:00.336  5645  5692 I godot   : OpenGL ES Batching: ON
    01-17 13:10:00.441  5645  5692 I godot   :
    01-17 13:10:03.773  5645  5692 I godot   : Sign in called
    01-17 13:10:03.775  5645  5645 I godot   : Using new signin data
    01-17 13:10:04.646  5645  5692 I godot   : Google Play Service: login successful
    01-17 13:10:05.224  5645  5645 I godot   : Sign in data is valid
    01-17 13:10:05.262  5645  5692 I godot   : Editor, GodotYodo1Mas initialized
    01-17 13:10:05.263  5645  5692 I godot   : Initialize yodo sdk
    01-17 13:10:05.263  5645  5692 I godot   : OS.get_name()
    01-17 13:10:05.359  5645  5692 I godot   : Save failed
    01-17 13:10:05.360  5645  5692 I godot   : Save failed
    01-17 13:10:06.159  5645  5645 W godot   : GodotYodo1MasWrapper -> initialize successful
    
    opened by damnedpie 1
  • Fixes to Client Id problem

    Fixes to Client Id problem

    Yes im using that. This is still an issue however I figured out how to get it all to work. You need to make sure you have both web and android authentication on your app. image and make sure you have both authes in your app image

    BE SURE TO PUBLISH THEM OR IT WILL NOT WORK

    Finally be sure to set your token in the code the read me says nothing of this but it will cause a full crash on your app causing this stack trace image  The client id is the WEB not the android one it does not specify it in the readme.

    Originally posted by @finepointcgi in https://github.com/StudioAdriatic/PGSGP/issues/5#issuecomment-1005093647

    I was having problems with SignIn, having bizarre AndroidRuntimeErrors, having some failure IDs constant 10...

    So I've done that and still get the same exact problems. Is there something else to do?

    opened by olgam4 1
  • Fatal crash when achievement info fails to load

    Fatal crash when achievement info fails to load

    Hi! First off, thank you so much for maintaining this fantastic plugin! I have been using it in my Godot game without much issue so far.

    I encountered a crash however that I think should be easily fixable:

    11-24 20:55:49.147  5480  5480 E AndroidRuntime: FATAL EXCEPTION: main
    11-24 20:55:49.147  5480  5480 E AndroidRuntime: Process: com.pank0.usagishima, PID: 5480
    11-24 20:55:49.147  5480  5480 E AndroidRuntime: java.lang.IllegalArgumentException: Invalid arguments count. Should be 1  but is 0
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at org.godotengine.godot.plugin.GodotPlugin.emitSignal(GodotPlugin.java:368)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at org.godotengine.godot.plugin.GodotPlugin.emitSignal(GodotPlugin.java:343)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at io.cgisca.godot.gpgs.PlayGameServicesGodot.onAchievementInfoLoadingFailed(PlayGameServicesGodot.kt:375)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at io.cgisca.godot.gpgs.achievements.AchievementsController.loadAchievementInfo(AchievementsController.kt:113)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at io.cgisca.godot.gpgs.PlayGameServicesGodot.loadAchievementInfo$lambda-10(PlayGameServicesGodot.kt:268)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at io.cgisca.godot.gpgs.PlayGameServicesGodot.$r8$lambda$Lj4qxSyZ7Gf4YV_JHXpPDQ4X9pY(Unknown Source:0)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at io.cgisca.godot.gpgs.PlayGameServicesGodot$$ExternalSyntheticLambda9.run(Unknown Source:4)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:883)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:100)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:214)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7397)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
    11-24 20:55:49.147  5480  5480 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
    11-24 20:55:49.294  2947  6825 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
    11-24 20:55:49.312  2947 10102 W ActivityTaskManager:   Force finishing activity com.pank0.usagishima/com.godot.game.GodotApp
    

    The cause of the crash seems to be an incorrect number of arguments passed to the _on_achievement_info_load_failed signal. It appears that the number of arguments declared for this signal is incorrect in PlayGameServicesGodot.kt. The following change seemed to fix the crashes for me:

    --- a/app/src/main/java/io/cgisca/godot/gpgs/PlayGameServicesGodot.kt
    +++ b/app/src/main/java/io/cgisca/godot/gpgs/PlayGameServicesGodot.kt
    @@ -65,7 +65,7 @@ class PlayGameServicesGodot(godot: Godot) : GodotPlugin(godot), AchievementsList
          val SIGNAL_ACHIEVEMENT_STEPS_SET_FAILED =
              SignalInfo("_on_achievement_steps_setting_failed", String::class.java)
          val SIGNAL_ACHIEVEMENT_INFO_LOAD = SignalInfo("_on_achievement_info_loaded", String::class.java)
    -        val SIGNAL_ACHIEVEMENT_INFO_LOAD_FAILED = SignalInfo("_on_achievement_info_load_failed", String::class.java)
    +        val SIGNAL_ACHIEVEMENT_INFO_LOAD_FAILED = SignalInfo("_on_achievement_info_load_failed")
          val SIGNAL_LEADERBOARD_SCORE_SUBMITTED = SignalInfo("_on_leaderboard_score_submitted", String::class.java)
          val SIGNAL_LEADERBOARD_SCORE_SUBMITTED_FAILED =
              SignalInfo("_on_leaderboard_score_submitting_failed", String::class.java)
    

    If someone could confirm the fix is indeed correct, I can submit a pull request if you want.

    Thanks a lot!

    opened by flaming-toast 0
  • Exception java.lang.RuntimeException

    Exception java.lang.RuntimeException

    I get frequent crashes with this plugin. My game runs on about 1k devices and I get 1 crash every 2 days. Its not too bad but would still be nice to have this resolved. I cannot reproduce the crash on my test devices, neither emulate nor real ones. The crashes occur on Android 10 and 11.

    Stack Trace:

    Exception java.lang.RuntimeException: at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4451) at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4483) at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2175) at android.os.Handler.dispatchMessage (Handler.java:107) at android.os.Looper.loop (Looper.java:237) at android.app.ActivityThread.main (ActivityThread.java:7860) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:493) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1075) Caused by java.lang.RuntimeException: at android.app.ActivityThread.deliverResults (ActivityThread.java:5143) at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4438) Caused by kotlin.UninitializedPropertyAccessException: at io.cgisca.godot.gpgs.PlayGameServicesGodot.onMainActivityResult (PlayGameServicesGodot.kt:158) at org.godotengine.godot.Godot.onActivityResult (Godot.java:295) at org.godotengine.godot.FullScreenGodotApp.onActivityResult (FullScreenGodotApp.java:122) at android.app.Activity.dispatchActivityResult (Activity.java:8292) at android.app.ActivityThread.deliverResults (ActivityThread.java:5136)

    opened by patrick-wagner-0681 1
  • [Bug] Nonexistent function 'init' in base 'JNISingleton'

    [Bug] Nonexistent function 'init' in base 'JNISingleton'

    I'm using godot 3.4.4 and testing on an Android 12 device.

    The test run returns " Nonexistent function 'init' in base 'JNISingleton' ".

    Since init is present in ths plugin:

     override fun getPluginMethods(): MutableList<String> {
            return mutableListOf(
                "isGooglePlayServicesAvailable",
                "init",
    ...
    }
    

    and:

    fun init(enablePopups: Boolean, requestEmail: Boolean, requestProfile: Boolean, requestToken: String) {
            initialize(false, enablePopups, "DefaultGame", requestEmail, requestProfile, requestToken)
        }
    

    I think it's a godot version related issue? Is this plugin still being maintained?

    opened by luiscesjr 1
  • Frequent crashes on Android 12

    Frequent crashes on Android 12

    Hi! Been receiving a lot of crash reports on Google Play Console, 90% of those crashes occur on Android 12 (SDK 31-32). Got over 100 stack traces, all of them look like this:

    java.lang.RuntimeException: at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4891) at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:4928) at android.app.servertransaction.ResumeActivityItem.execute (ResumeActivityItem.java:52) at android.app.servertransaction.TransactionExecutor.executeLifecycleState (TransactionExecutor.java:176) at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2309) at android.os.Handler.dispatchMessage (Handler.java:106) at android.os.Looper.loop (Looper.java:246) at android.app.ActivityThread.main (ActivityThread.java:8587) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:602) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1130) Caused by: java.lang.RuntimeException: at android.app.ActivityThread.deliverResults (ActivityThread.java:5533) at android.app.ActivityThread.performResumeActivity (ActivityThread.java:4878) Caused by: kotlin.UninitializedPropertyAccessException: at io.cgisca.godot.gpgs.PlayGameServicesGodot.onMainActivityResult (PlayGameServicesGodot.kt:158) at org.godotengine.godot.Godot.onActivityResult (Godot.java:295) at org.godotengine.godot.FullScreenGodotApp.onActivityResult (FullScreenGodotApp.java:122) at android.app.Activity.dispatchActivityResult (Activity.java:8550) at android.app.ActivityThread.deliverResults (ActivityThread.java:5526)

    And it is always the io.cgisca.godot.gpgs.PlayGameServicesGodot.onMainActivityResult (PlayGameServicesGodot.kt:158)

    I use Saved Games and logging in, nothing else. Recently I have added Achievements to my game, but it had no further impact on crash rate. Android 11 and below work pretty stable, but Android 12 is misbehaving for sure.

    opened by damnedpie 0
  • [Feauture request] Is it possible to retrieve leaderboard data?

    [Feauture request] Is it possible to retrieve leaderboard data?

    Hey,

    I want to give the players rewards based on the players rank in a leaderboard, more specific I would need to get this info of the submitted score: https://developers.google.com/android/reference/com/google/android/gms/games/leaderboard/LeaderboardScore#getRank()

    Would this be possible to do? If it is, am I correct to leave it here as a feature request or do I have to post it somewhere else?

    The list of the other scores (players before and after the player plus maybe top ten scores) would be a nice to have too.

    opened by Tobi-La 0
2D physics engine for games

LiquidFun Version 1.1.0 Welcome to LiquidFun! LiquidFun is a 2D physics engine for games. Go to our landing page to browse our documentation and see s

Google 4.5k Dec 31, 2022
Game made with Korge (Kotlin Multiplatform game engine)

MolesAttack Kotlin Multiplatform Game Play Html/js: https://feliperce.github.io/MolesAttack-Distribution/ Jar: https://feliperce.github.io/MolesAttack

Felipe Rodrigues 10 May 30, 2022
Gameforma is a simple game list application where user could explore more than 350.000 games

Gameforma is a simple game list application where user could explore more than 350.000 games data provided from RAWG Video Games Database API. Built with MVVM repositoy pattern, clean architecture in order to finish Dicoding Menjadi Android Developer Expert's (MADE) class submission.

Naufal Aldy Pradana 3 Sep 22, 2022
This is an application that is about an X / O game. You can enter the names of the game, and there is also a screen for those who win and there is a button to continue playing and the game determines the result of each player

Game-X-O This is an application that is about an X / O game. You can enter the names of the game, and there is also a screen for those who win and the

Mohamed Rafat 2 Aug 20, 2022
Free Android 2D OpenGL Game Engine

AndEngine Donations While developing AndEngine was a lot of fun, it also also consumed many(!) months of my life. It actually continues to cost me a s

Nicolas Gramlich 3.2k Jan 5, 2023
A cross-platform Java game Engine (Framework) , support JavaFX / Android / IOS / HTML5 / Linux / MAC / Windows

Loon Game Engine (Java Game Framework) EN / KR Free Game Resources Links Download Loon Game Engine Only Android-studio Template : androidstudio-templa

cping 502 Jan 4, 2023
SMBClone - SMD clone custom game engine. (Desktop + Android)

SMBClone Simple crossplatform game engine for like SMB game! Supported platforms

Victor Varenik 4 Jul 4, 2022
Korjector is a KorGE game engine-based multiplatform client for Projector.

Korjector is a KorGE game engine-based multiplatform client for Projector. An internal JetBrains Hackathon 2021 project to demonstrate that a Projector client can be created in less than 48 hours for any OS that supports decent canvas 2D API.

Sergei Bulgakov 10 Nov 20, 2021
RemsEngine - OpenSource Kotlin/OpenGL/ECS based game engine

Game Engine: Rem's Engine Parallel to this video editor, I am developing my own

Antonio 7 Nov 3, 2022
A simple launcher for Meta Quest VR headsets supporting Android/Official Quest/SideQuest apps and games

Quest PiLauncher This is a simple launcher for Meta Quest VR headsets supporting Android/Official Quest/SideQuest apps and games. Builds, VIdeo Compil

Luboš Vonásek 47 Dec 29, 2022
Extracts thousands of chess games

Chess Games Extractor Extracts chess games to a file. The main goal is presentin

Nyckollas Brandão 0 Jul 31, 2022
Android Game App made with kotlin. Allows to play online on the same network!

Reversi - Kotlin/Android Project made for Arquiteturas Móveis at ISEC 2021/2022 Notes Build gradle to run app or install the 'reversi.apk' directly on

André Lopes 1 Feb 5, 2022
Our maze game is an 2d-animation game developed using android studio.

Our maze game is an 2d-animation game developed using android studio. The game consists of a ball and a board with a hole in the center of it. We are using accelerometer as controller to guide ball towards the hole. T

Suraj Devgan 6 Nov 29, 2022
Android OpenGL ES 2.0/3.0 Engine

Build Status Master Branch Status Develop Branch Status News 06/23/2017 Bombshell 1.1.970 has been released. It fixes behavior of Objects of zero size

null 2.2k Jan 9, 2023
a 2d Java physics engine, native java port of the C++ physics engines Box2D and LiquidFun

jbox2d Please see the project's BountySource page to vote on issues that matter to you. Commenting/voting on issues helps me prioritize the small amou

jbox2d 1k Jan 2, 2023
RPG written in Kotlin using Korge engine

TheAlchemist RPG written in Kotlin using the Korge engine Based on the template https://github.com/korlibs/korge-starter-kit-rpg, this is a simple pix

Liam 2 Jan 16, 2022
An experiment with cellular automata; Functional mod for Rem's Engine.

Cellular Automata This is an experiment with cellular automata. A functional mod for Rem's Engine. When experimenting, I found the Sierpinski Triangle

Antonio 1 Mar 21, 2022
An easy open source Android Native Game FrameWork.

JustWeEngine - Android Game FrameWork An easy open source Android Native Game FrameWork. Engine Flow Chart How To Use? Import Engine's module as Libra

JustWe 767 Dec 8, 2022
Desktop/Android/HTML5/iOS Java game development framework

Cross-platform Game Development Framework libGDX is a cross-platform Java game development framework based on OpenGL (ES) that works on Windows, Linux

libgdx 20.9k Jan 8, 2023