1. Hey! Guest! The 35th GMC Jam will take place between November 28th, 12:00 UTC - December 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice

Android [Solved] AchievementLogin() no longer working

Discussion in 'GameMaker Studio 2 Community Tech Support' started by Tekuzo, Oct 19, 2019.

  1. Tekuzo

    Tekuzo Member

    Joined:
    Feb 11, 2018
    Posts:
    7
    I had an app in Google Play and I recently got an email from Google saying that I was using an out of date extension and I needed to update it. Thankfully I saw that Yoyo games had updated the google play services extension.

    I downloaded the new extension and ran a debug of my game to make sure everything worked.
    For some reason I can no longer log into the Google Play Serivces so achievements and leaderboard scores would no longer work.

    Here is an output of my debug log


    10-19 10:22:52.186 14927 14961 I yoyo : AchievementLogin()
    10-19 10:22:52.201 14927 14927 I yoyo : Signing in..
    10-19 10:22:52.250 14927 14961 I Ads : Updating ad debug logging enablement.
    10-19 10:22:52.257 14927 14995 W Ads : Update ad debug logging enablement as false
    10-19 10:22:52.359 14927 14961 I yoyo : vsync timeout...
    10-19 10:22:52.432 14927 14927 I yoyo : Silent sign in failed, attempting normal sign in..
    10-19 10:22:52.458 14927 14927 I yoyo : onPause
    10-19 10:22:52.471 14927 14927 I yoyo : Pausing the Runner
    10-19 10:22:52.553 14927 14961 I yoyo : vsync timeout...
    10-19 10:22:52.606 14927 14927 I yoyo : onWindowFocusChanged(false|false)
    10-19 10:22:52.606 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:52.636 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:52.661 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:52.717 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:53.109 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:53.138 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:53.163 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:53.219 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:57.137 14927 14927 I yoyo : Got activity result: 0
    10-19 10:22:57.137 14927 14927 I yoyo : gps onActivityResult called. RequestCode: 9001. ResponseCode: 0
    10-19 10:22:57.138 14927 14927 I yoyo : Login failed! Exception: com.google.android.gms.common.api.ApiException: 4: . Message: 4: . Stack: [Ljava.lang.StackTraceElement;@cf5ba78
    10-19 10:22:57.142 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:57.142 14927 14927 I yoyo : End Got activity result
    10-19 10:22:57.142 14927 14927 I yoyo : onResume
    10-19 10:22:57.145 14927 14927 I yoyo : Setting vis flags to 5894
    10-19 10:22:57.145 14927 14927 I yoyo : resumeApp
    10-19 10:22:57.145 14927 14961 I yoyo : chooseConfig


    Doing a google search for the exaxt exception i have been getting doesn't seem to give me any results. I am not sure what is going on.
     
    Nzekwe Precious likes this.
  2. chirpy

    chirpy Member

    Joined:
    Oct 6, 2016
    Posts:
    156
    I had also confronted this very same issue and managed to resolve it based on previous experience.
    In my case it was caused by an sha1 signing key mismatch from my test apk (signed by gamemaker studio) and my google play services backend records (signing key managed by Google).

    To see which key the backend expects, you can check:
    https://console.developers.google.com/apis/credentials
    by selecting your project (probably listed under "all") -> Credentials -> OAuth 2.0 client IDs -> edit (pencil icon) -> Signing-certificate fingerprint
    screenshot_0449 2019-10-25.png
    screenshot_0450 2019-10-25.png
    Under "Signing-certificate fingerprint" section of your client ID, there's an sha1 key (in colon separated hex digits, sha1 hash format).

    It should match your game's keystore's key hash (gamemaker preferences -> platform settings -> android -> keystore -> show key hash). This is called your "upload certificate" key.

    If they do not match, temporarily editing the client ID to use the upload certificate key allows you to connect to the backend service with gms-signed apk without uploading to Google Play Console.

    After uploading to Google Play Console, the sha1 key in your apk will be replaced by the one listed under Release Management -> App Signing -> App signing certificate -> SHA-1 certificate fingerprint.
    This is caused by agreeing to use recommended "app signing" feature when first uploading to Google Play Console.

    screenshot_0452 2019-10-25.png

    screenshot_0451 2019-10-25.png

    After testing is done, remember to change the key back to Google's "app signing certificate" fingerprint, so people who use your Google Play Store apk can access the achievements service.

    Perhaps there's a better way to do this, if anyone knows please don't hesitate to share.
    (Don't try to add another client ID to use the upload certificate fingerprint like I did. I had issues deleting IDs. Duplicate records will remain, making the fingerprint unusable.)

    ====
    If you don't have your Game Service linked to your app yet, you can do so from your application's Development Tools -> Services & APIs -> enable Google Play game services
    If you did not use app signing: please contact Google for technical support (that's how I got to know all about this sha1 mismatch).
    Other possibilities: I don't know =\
     
    Last edited: Oct 25, 2019
    Tekuzo likes this.
  3. Tekuzo

    Tekuzo Member

    Joined:
    Feb 11, 2018
    Posts:
    7
    Thank you for your help.
    I logged into the APIs console and must have made some sort of change while trying to figure out what to do because my achievements started working again all of a sudden.
     
  4. chirpy

    chirpy Member

    Joined:
    Oct 6, 2016
    Posts:
    156
    Sounds .. great? Be aware to also test builds that are uploaded to Google Play Console and downloaded via store link later, because they may stop working and again need sha1 fingerprint edits, if you followed my steps.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice