Hi all. Over the past few days, my coding partner and I have been painstakingly trying to implement Google Play Games into our upcoming Android title. We have recently come across a fairly large hurdle that we cannot seem to find a solution for despite many other forum posts and StackOverflow answers we have tried to use. The issue is that after all of the setup, Google Play Games does not appear in our game in any capacity (at the start or any action affiliated with GPG). The addition of trying to get this into the game has also caused multiple errors when trying to build the game.
Unity version: 2019.4.14f1
Google Play Games Version: 10.12
Target platform: Android
Fixes attempted to get Google Play Games to work/appear in-game to not result
Downgrading Google Play Games from its latest version of 10.12 to 0.9.64 to no change
Uninstalling and reinstalling Google Play Games at least 4 times
Using a new scene only using a script from a tutorial linking to Google Play Games
Redoing the Play Games services configuration in the Google Play Console ~3 times
Using a Custom Proguard File - with ~5 different lists of files suggested by other posts
Not using a Custom Proguard File
Project Settings\Player\Minify both Release and Debug set to Proguard
Using Jetifier set to true
Doing both āResolveā and āForce Resolveā
Published on the Play Games services configuration
Uploading the game to the Google Play Console, and playing a downloaded version from an internal testing release
Removing Admob, and retrying the steps above
*Strip Engine Code has been both tried enabled and disabled
Versions 10.06, 9.64 and 9.58 of Google Play Games produce a 'JAVA_HOME environment references error
Resolved by changing the JDK and SDK to not Unity Default
My analysis:
One of the last-ditch errors was believing it was Admob causing the issue. I gutted it from the project entirely and followed the same steps of adding it to the Google Play Console for download. Upon trying the game, GPG was not there. I tried building it from Unity and the last error I got before writing this post was the ClassNotFound, which did not make sense to me as I had Proguard on to prevent that. The game does not give this error when run in the editor (though does not function, as expected).
I created a new, empty project. I added some basic UI and imported the Google Play Games package, added the XML resource and it worked. Eventually moved all gameplay elements to this project and the game worked. Tried to add Google Admob and it resulted in the same effects as before - Deletes the class file and does not function, leaving me at Step 1.
Unity version is the same - 2019.4.14f1
Google Play Games version is 10.12
Admob version is 6.1.0
any luck with this? I canāt even get the sample project to work that is provided in the github repo. i believe i have followed all of the steps correctly but still no luck
Check if any proguard files are active. This usually happens if you have any obfuscation/proguard enabled in your project.
If any one looking for a leaderboards/achievements solution (for iOS & Android) which is constantly supported, you can give a try with our Cross Platform Native Plugins : Essential Kit plugin. We constantly monitor the product and update the fixes so that you donāt need to waste your valuable time. We have 14+ more features in the same plugin.
It is unbelievably difficult to get Google Play Games services to work in Unity. I have been dealing with it since 2018. I remember spending DAYS to get it working. The documentation is useless, and I browses just about all forum posts just like you, finding hundreds of frustrated people, each spending hours fumbling around blindfolded to get it to workā¦
Let me give you an example on how the documentation is useless, this is from the package github instructions page:
Notice āDepending on if you are using the SDK manager from Android Studio, or using the standalone SDK manager, the name of the components may be differentā
Thatās great, only āGoogle Play Servicesā and āAndroid 6.0ā is visible in the SDK manager, and I spend hours of googling how to find these other mysterious requirements - without luck.
Anyway, one day I got it to work and was SO relieved. But about a year later it stopped working for unknow reason, I spend a week trying to get it to work again, but no cigar. And I actually stopped working on the project in 2020 because of this⦠Only a month ago I decided to pick up the project again, and get rid of google play games all together, and implement Unity Gaming Services instead. But now I realize that I am kind of gonna need it anyway, because I need to sign people in to a identity provider⦠So I gave gpgs a shot again for the 4th time. And my head is literally exploding. Never had I had an as horrible implementation experience, there are literally hundreds of post all with different errors, and people seem to randomly fix (or not) their issue by spending hours trying out just about everything, and there seems to be no pattern in what works for who, thereās just so many thing that can be a problemā¦
Iāve read someone saying, āoh but the andoid SDK that comes with unity is not compatible with the gpgs packageā you need to download another SDK and point your unity editor to use that sdk - this worked for some people, but not for others, and wasnāt necessary for all.
I have been fortunate enough to get most things to work properly with GPGS and have been playing around with it for about a year now in my current project. If there is something you currently having an issue with, I may be able ot point you in the right direction. I do agree that working with googleās plugins is worse than a nightmare, but it is unfortunately ānecessaryāā¦
Thatās very kind of you! At the moment I have implemented Authentication with Facebook as identity provider, using the facebook SDK instead - this went a lot smoother, as the resolver could resolve everything, and I didnāt have to get some specific version of JDK and didnāt have to make modifications to the android NDK or SDK. I did have to fiddle a bit around with proguard though - but it was less painfulā¦
I do though believe that I will need GPGS in the future⦠I will come back here and cry for help then
I know itām few years behind, but in cases of Javaās ClassNotFound exception, doesnāt adding the missing classā path to the custom proguard solve the issue?
Iāve had a similar error with v11.01, claiming that com.google.android.gms.games.PlayGames was not found, so I added: -keep class com.google.android.gms.games.PlayGames.* { *; }
to my custom proguard, and it seems to be working now (at least for me).
Working on a deeper level with java, xml, the proguard file, and many android specific features is new in general to me and Iām sure it is for a lot of others as well. Iām still exploring and learning all of these features and languages. Iām sure many basic users such as myself assume (or rather, expect) that a plugin should work without having to apply custom fixes for something that should just work.