- Home /
Google Play Games Cloud Save - NullReferenceException when accessing GooglePlay SavedGame
I am trying to implement GooglePlayGames Cloud Save to my game. I am currently running into the following error:
NullReferenceException: Object reference not set to an instance of an object
GooglePlayManager.LoadFromCloud () (at Assets/Scripts/Luke/Singletons/GooglePlayManager.cs:52)
GooglePlayManager.<SignIn>m__0 (Boolean success) (at Assets/Scripts/Luke/Singletons/GooglePlayManager.cs:42)
GooglePlayGames.PlayGamesPlatform+<Authenticate>c__AnonStorey0.<>m__0 (Boolean success, System.String msg) (at Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs:383)
GooglePlayGames.BasicApi.DummyClient.Authenticate (System.Action`2 callback, Boolean silent) (at Assets/GooglePlayGames/BasicApi/DummyClient.cs:50)
GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`2 callback, Boolean silent) (at Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs:414)
GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`1 callback, Boolean silent) (at Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs:383)
GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`1 callback) (at Assets/GooglePlayGames/ISocialPlatform/PlayGamesPlatform.cs:348)
GooglePlayGames.PlayGamesLocalUser.Authenticate (System.Action`1 callback) (at Assets/GooglePlayGames/ISocialPlatform/PlayGamesLocalUser.cs:49)
This is in regards to the following line:
savedGameClient.OpenWithAutomaticConflictResolution(
m_saveName, //name of file.
DataSource.ReadCacheOrNetwork,
ConflictResolutionStrategy.UseLongestPlaytime,
SavedGameOpened);
I have checked and the Instance is being authorised and set fine, but when it comes to trying to use GooglePlayGames.Instance.SavedGame it brings up a NullReferenceException.
I have tried uploading to an Internal Test on Google Play Store to see if it was just because Unity Editor didn't like it, and that didn't work either. It signs me into google play fine, but no data is being sent or saved. I did a check with logcat just to make sure and it still displays the same error as it does in the Unity Editor.
So basically any help would be appreciated. I've done achievements and leaderboards in another game before without any issue, but this is proving difficult.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Google Play Permissions and Manifest files help 1 Answer
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer