Hey! We’ve been using Play Games Plugin for almost half a month without any kind of problem. We could use it to log in, unlock achievements, and so on. However, a few days ago it stopped working. There’s not even the log in prompt. We have already tried these solutions:
Update to Unity 2020
Use a custom proguard file (as we read here on other issues) and tick the “release” box, then forced resolve
Change the code, using it on start and on a button, just in case it had something to do with trying to log in too soon. Also, we tried to isolate the issue by using prints
Checked the google and the google play consoles, even removed the google play services and set them from zero. We have two credentials, and both SHA-1 are fine (for both apks and google play downloads)
OAuth seems to be fine
Using logcat to debug the errors (image below)
The only thing we did on the project since it started working was to add In App Purchases, however, I don’t think it had anything to do.
Lastly, I was so sure everything was perfectly set up that I created a new project, and the same script is working flawlessly on it. We’ve run out of ideas, and we could use any help you could provide. If you need anything else, just ask for it ^^. We also posted it on their github, however, we thought some of you may have faced the same problem before and could give us a hand.
Hi, just wondering if either of you figured this out? This is a top search result on Google so it would be great if a solution could be posted. Thanks!
First try updating your External dependency manager to latest version by downloading from here and try resolving it.
If it doesn’t work,
Try giving a version number and see if its able to resolve. (for ex: com.google.games:gpgs-plugin-support:0.10.11)
It may not be the latest version as I found that version online. Basically, its just to see if its resolving properly or not. Surprisingly, I didn’t find it any where at maven.google.com
Hmm, okay. No, the updated external dependency manager still does not resolve successfully. I am going to make a new project and import everything one at a time. It’s terrible that Unity and/or Google have so many engine-breaking issues like this. It seems that every mobile game I make has something that sets back development by at least a few long days.
It turns out that it was an issue with my ExternalDependencyManager and a config file that caused it to fail resolution with this error:
"Resolution failed
Failed to fetch the following dependencies:
com.google.games:gpgs-plugin-support:+"
The issue was that my GooglePlayGamesPluginDependencies.xml was pointing to a directory that did not exist.
This comment’s fix worked for me:
Hello, I´m getting the same error and don´t know what else try. Already updated proguard file, runned resolver, etc. Im building and the build works fine in the device but when attempting to log in or show the leaderboard I get this error:
AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames
java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:454)
at com.unity3d.player.UnityPlayer.nativeRender(Native Method)
at com.unity3d.player.UnityPlayer.access$500(Unknown Source:0)
at com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:126)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
Caused by: java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames
... 9 more
at UnityEngine.AndroidJNISafe.CheckException () [0x00000] in <00000000000000000000000000000000>:0
at UnityEngine.AndroidJNISafe.FindClass (System.String name) [0x00000] in <00000000000000000000000000000000>:0 2
I tried to solve this problem for a long time and finally succeeded. I tried a lot, but in the end the following helped: Assets → External Dependency Manager → Android Resolver → Force Resolve
I tried the force resolve probably over 100 times as well. The path in the GooglePlayGamesPluginDependencies.xml was correct, my dll’s were set up correctly as well. However, it turns our for me I had some unresolved libraries that was not fixed with force resolve. I fixed the issue by using the Android Resolve > Delete Resolved Libraries, then force resolving again. Somehow, that worked.
By the way, gpgs version 11.04 does not work for me either. I rolled back to version 10.14
Thank you for the comprehensive steps, wished it was linked from the Unity docs. What a pain to get this working as there is a string of items to resolve. If some are also not having their dependency manager resolve correctly this helped me.
I use GPGS v0.11.01 and was same error java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames.
Android Force Resolve failed with an error Failed to fetch the following dependencies: com.google.games:gpgs-plugin-support:+.
How did I fix it:
open the file Assets/GooglePlayGames/com.google.play.games/Editor/GooglePlayGamesPluginDependencies.xml
change line Packages/com.google.play.games/Editor/m2repository to Assets/GooglePlayGames/com.google.play.games/Editor/m2repository
Hi I tried to change this line of code in GooglePlayGamesPluginDependencies.xml form this <repository>Packages/com.google.play.games/Editor/m2repository</repository>
to this <repository>Assets/GooglePlayGames/com.google.play.games/Editor/m2repository</repository>
I hope this help you