playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.46k stars 966 forks source link

InvalidOperationException: There was an error creating a GameServices object #2280

Open Felipessoaf opened 6 years ago

Felipessoaf commented 6 years ago

When trying to sign in using Unity 2018.2 with GooglePlayGamesPlugin-0.9.50 I get this error. (Solution #2013 did not work for me) Here is the logcat:

I/Unity(801): GooglePlayGames.Native.NativeClient:InitializeGameServices() (at \Assets\GooglePlayGames\Platforms\Native\NativeClient.cs:227) I/Unity(801): GooglePlayGames.Native.NativeClient:Authenticate(Action2, Boolean) (at \Assets\GooglePlayGames\Platforms\Native\NativeClient.cs:139) I/Unity(801): GooglePlayGames.PlayGamesPlatform:Authenticate(Action2, Boolean) (at \Assets\GooglePlayGames\ISocialPlatform\PlayGamesPlatform.cs:414) I/Unity(801): GooglePlayGames.PlayGamesPlatform:Authenticate(Action1, Boolean) (at \Assets\GooglePlayGames\ISocialPlatform\PlayGamesPlatform.cs:383) I/Unity(801): GooglePlayGames.PlayGamesP

Error starts here:

E/Unity(801): InvalidOperationException: There was an error creating a GameServices object. Check for log errors from GamesNativeSDK E/Unity(801): at GooglePlayGames.Native.PInvoke.GameServicesBuilder.Build (GooglePlayGames.Native.PInvoke.PlatformConfiguration configRef) [0x0003a] in \Assets\GooglePlayGames\Platforms\Native\PInvoke\GameServicesBuilder.cs:192 E/Unity(801): at GooglePlayGames.Native.NativeClient.InitializeGameServices () [0x0010a] in \Assets\GooglePlayGames\Platforms\Native\NativeClient.cs:229 E/Unity(801): at GooglePlayGames.Native.NativeClient.Authenticate (System.Action2 callback, Boolean silent) [0x000f7] in \Assets\GooglePlayGames\Platforms\Native\NativeClient.cs:139 E/Unity(801): at GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action2 callback, Boolean silent) [0x00031] in \Assets\GooglePlayGames\ISocialPlatform\PlayGamesPlatform.cs:414

MrSunflower commented 6 years ago

I have a similar problem, possibly even the same problem.

I get that same: "InvalidOperationException: There was an error creating a GameServices object." error. However, for me, it starts earlier.

At the very beginning of my code, in my Start(), I get an error right after I call PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); The error is: 09-04 19:05:46.907 20029-20047/? E/Unity: NullReferenceException: Object reference not set to an instance of an object I've bracketed the Builder().Build() line with Debug.Log statements. The Debug.Log above it works just fine, while the Debug.Log below it doesn't print. So as best I can tell, there is something in the Builder().Build() statement that is causing a NullReferenceException. And the failure at this point then leads to the later GameServicesObject error that you are talking about.

@Felipessoaf - Does this sound anything like what you're getting?

smithmj5 commented 6 years ago

I'm having a similar problem too.

Using Unity 2017.4.3f1 and GooglePlayGamesPlugin-0.9.50

The weird part is that it works fine for hundreds of thousands of players, but every day I receive about 5-10 bug reports with this error (stack trace from Unity - I can't get a logcat since I can't replicate the error on my devices):

[Exception] InvalidOperationException: There was an error creating a GameServices object. Check for log errors from GamesNativeSDK
    GooglePlayGames.Native.PInvoke.GameServicesBuilder.Build (GooglePlayGames.Native.PInvoke.PlatformConfiguration configRef)
    GooglePlayGames.Native.NativeClient.InitializeGameServices ()
    GooglePlayGames.Native.NativeClient.Authenticate (System.Action`2 callback, Boolean silent)
    GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`2 callback, Boolean silent)
    GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`1 callback, Boolean silent)
    GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action`1 callback)
    GooglePlayGames.PlayGamesLocalUser.Authenticate (System.Action`1 callback)