playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.43k stars 952 forks source link

SavedGames, Internal error and "Must include Drive.SCOPE_APPFOLDER to use snapshots" #3129

Closed schouffy closed 2 years ago

schouffy commented 2 years ago

Describe the bug I'm new with GPGS and the plugin, leaderboards were very easy to achieve, then SavedGames gave me a bit of a headache. Basically, if you have a very straightforward approach and follow the README, you'll probably face two issues: unhelpful error messages, and missing configuration.

To Reproduce Steps to reproduce the behavior:

  1. Follow the tutorial to install/configure, then the tutorial to log in to GPGS
  2. Follow the tutorial steps to query the SavedGames API (either ShowSelectSavedGameUI, OpenWithAutomaticConflictResolution or OpenWithManualConflictResolution)

Expected behavior It should display the SavedGames screen, or load the saved game, just as described in the README, or at least show helpful error messages if the configuration isn't correct.

Observed behavior Any call to the SavedGames API will return an InternalError and nothing else.

Bug Report I fixed my issue doing the following :

Thanks to that I saw the following message: "Must include Drive.SCOPE_APPFOLDER to use snapshots"

Looking it up online, I found a very similar issue #3076 with an example of how to initialize the PlayGameServices. I added the following in some early code in my online services manager class. Before that I had no (ie default) PlayGamesClientConfiguration in my game.

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration
        .Builder()
        .EnableSavedGames() // This is the important part
        .Build();

        PlayGamesPlatform.InitializeInstance(config);
        PlayGamesPlatform.DebugLogEnabled = true;
        PlayGamesPlatform.Activate();

Then all the calls started working.

Versions

Additional context I think this information should appear in the README, because right now it's hard to guess why the code doesn't work, and how to fix it.

eantaev commented 2 years ago

Hi Jérôme,

Thanks for reporting this problem!

Please note that we recently released a new major version of the Unity plugin (v11) and default branch points to v11 now. The goal of this new version is to simplify the setup. In particular, you don't need to declare SaveGames.

As you report, you're using a previous version v10. Here is the documentation for it - https://github.com/playgameservices/play-games-plugin-for-unity/tree/v10