playgameservices / play-games-plugin-for-unity

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

Can't authenticate with 0.9.26 (Could not register one or more required Java classes) #766

Closed dylanbevis closed 8 years ago

dylanbevis commented 8 years ago

I'm having trouble Authenticating with 0.9.26 version of the plugin.

I've made sure to download the latest version of the Google Play Services (27) and the Android SDK (22) but when I go to authenticate I get the follow errors:

E/GamesNativeSDK(18863): Could not register one or more required Java classes. I/Unity (18863): InvalidOperationException: There was an error creating a GameServices object. Check for log errors from GamesNativeSDK I/Unity (18863): at GooglePlayGames.Native.PInvoke.GameServicesBuilder.Build (GooglePlayGames.Native.PInvoke.PlatformConfiguration configRef) [0x00000] in :0 I/Unity (18863): at GooglePlayGames.Native.NativeClient.InitializeGameServices () [0x00000] in :0 I/Unity (18863): at GooglePlayGames.Native.NativeClient.Authenticate (System.Action1 callback, Boolean silent) [0x00000] in <filename unknown>:0 I/Unity (18863): at GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action1 callback, Boolean silent) [0x00000] in :0 I/Unity (18863): at GooglePlayGames.PlayGamesPlatform.Authenticate (System.Action1 callback) [0x00000] in <filename unknown>:0 I/Unity (18863): at GooglePlayGames.PlayGamesLocalUser.Authenticate (System.Action1 callback) [0x00000] in :0 I/Unity (18863): at SocialManager.Start () [0x00000] in :0

Any help would be greatly appreciated.

claywilkinson commented 8 years ago

Earlier in the log there will be error messages about which classes are not registered. You'll need to run Window > Google Play Games > Setup > Android Setup... again to add the updated SDK files to your application.

dylanbevis commented 8 years ago

The only other error message I can find from GamesNativeSDK is:

E/GamesNativeSDK( 8945): Can't register class com/google/android/gms/appstate/AppStateManager: an exception occurred.

Or would there be others listed under another name?

I've redone the setup but still getting the same issue.

claywilkinson commented 8 years ago

That's the one! This means you are using an old version of the plugin (or the libraries that are part of the plugin. Try deleting the Plugins/Android/libs directory and re-import the plugin.

dylanbevis commented 8 years ago

Ah great that was it, another plugin I'm using puts stuff in the libs folder so I didn't realise this plugin does as well.

Thanks for the help!