google play connection / error "could not be found"

Hello !

I try to install the connection with google play…
with the code below that I found here : GitHub - playgameservices/play-games-plugin-for-unity: Google Play Games plugin for Unity

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GooglePlayGames;

public class GoogleSign : MonoBehaviour
{
    public void Start()
    {
        PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
    }

    internal void ProcessAuthentication(SignInStatus status)
    {
        if (status == SignInStatus.Success)
        {
            // Continue with Play Games Services
        }
        else
        {
            // Disable your integration with Play Games Services or show a login button
            // to ask users to sign-in. Clicking it should call
            // PlayGamesPlatform.Instance.ManuallyAuthenticate(ProcessAuthentication).
        }
    }
}

I get an error and I don’t understand how to fix the problem.

error //// Assets\GoogleSign.cs(13,41): error CS0246: The type or namespace name 'SignInStatus' could not be found (are you missing a using directive or an assembly reference?)

I’ve tried several different codes but I feel like some functions are missing each time.

Can you help me please ? thx !

SignInStatus is in the GooglePlayGames.BasicApi -Namespace.

You’re missing a using GooglePlayGames.BasicApi at the top of your script.

Edit: Also, this question should be put in the Android-subsection of the forum, as it’s related to Google Play specifically.

I completely forgot… thank you very much… I’m tired :stuck_out_tongue:

1 Like

hmmmm …
it still doesn’t work… i have no error but i have no connection when starting the game.
Do you have any hints to help me?

I use GooglePlayGamesPlugin-0.11.01 …

I happen to currently be working on the same thing (a proprietary wrapper around both GPG and GameCenter for use in my company.
GPG is annoying, because it often doesn’t really provide good feedback about what you’re doing wrong.
All I can tell you is to check the following link very carefully: Setting Up Google Play Games Services | Google Developers and to check the “avoiding common setup problems” at the bottom of that link as well.

Some other things to take note of:

  • Make sure you have the correct SHA-1 set
  • Make sure your account is added as a test account in all locations (Play Console & Cloud Platform)
  • Make sure ‘anti-piracy’ is OFF when debugging, as it will hold back any app trying to authenticate that wasn’t downloaded directly from the play store.

Thank you for your answer.

  • Make sure you have the correct SHA-1 set
    Fix ! Well I guess…
  • Make sure your account is added as a test account in all locations (Play Console & Cloud Platform)
    good
  • Make sure ‘anti-piracy’ is OFF when debugging, as it will hold back any app trying to authenticate that wasn’t
    Fix !

but it still doesn’t work, I keep looking at your links to try to find.

Here’s the README I made for my custom wrapper (parts only relevant to the wrapper blacked out).

Also make sure you’re actually running on an Android-device, since you’ll have nothing to connect to otherwise.

Proguard-File should include:

-keep class com.google.android.gms.games.leaderboard.** { *; }
-keep class com.google.android.gms.games.snapshot.** { *; }
-keep class com.google.android.gms.games.achievement.** { *; }
-keep class com.google.android.gms.games.event.** { *; }
-keep class com.google.android.gms.games.stats.** { *; }
-keep class com.google.android.gms.games.* { *; }
-keep class com.google.android.gms.common.api.ResultCallback { *; }
-keep class com.google.android.gms.signin.** { *; }
-keep class com.google.android.gms.dynamic.** { *; }
-keep class com.google.android.gms.dynamite.** { *; }
-keep class com.google.android.gms.tasks.** { *; }
-keep class com.google.android.gms.security.** { *; }
-keep class com.google.android.gms.base.** { *; }
-keep class com.google.android.gms.actions.** { *; }
-keep class com.google.games.bridge.** { *; }
-keep class com.google.android.gms.common.ConnectionResult { *; }
-keep class com.google.android.gms.common.GooglePlayServicesUtil { *; }
-keep class com.google.android.gms.common.api.** { *; }
-keep class com.google.android.gms.common.data.DataBufferUtils { *; }
-keep class com.google.android.gms.nearby.** { *; }

@SF_FrankvHoof

Thank you for your answer !
It worked! I got the google login message.

I just have to figure out how to make the achivement haha !

good luck for your project :slight_smile:

1 Like

@SF_FrankvHoof
for archivement, it works! … it was not complicated! :slight_smile:

however, for the Google play save system… Its hard.
There’s not a lot of information on the Internet, did you succeed?

Have a look at https://developer.android.com/games/pgs/unity/saved-games
That should be enough to get you up & running.