-
Notifications
You must be signed in to change notification settings - Fork 963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames #3154
Comments
Hi, I am having exactly the same error using exactly the same versions of unity and the plugin.
I cannot express what hoops I had to jump through with so many issues along the way just to end up here. It's been weeks of googleing and this whole thing is so fragile, I wonder if it would even work an year from now. How to resolve this issue? |
Make sure you have checked the "Custom proguard txt" option in player settings, and that the txt file is located in Assets/Plugins/Android/proguard-user.txt |
Hi, thank you for the quick reply. I am not sure if the proguard custom file even matters, because I tried having it enabled and disabled, force resolving too and it did not help. What helped however, was to disable the Release checkbox and just leave the Debug one checked. Now I can authenticate. It doesn't show the native pop up, but I can see it in the logs, that it is there. The info I got was from here: https://forum.unity.com/threads/google-play-services-only-work-in-development-builds.1086623/ My credentials and key all use the official release keystore and I was expecting this to work even after minification is Release. I wonder now if the Release one would even work. Here is what I suspect: the Release minification strips the PlayGames code from the final build. Regarding the native authentication not showing, I see this ticket: #3130 Kind of not clear if this is already resolved but the code need to be released at some point. Idk. |
I have the same issue like you, Unity version, Firebase and same error. I will try to mark as debug to see if I can authenticate. |
Yeah I have it working only when unchecked the Release checkbox (as mentioned in my comment). All it needs is to make it get download the plugin and build it with the app. |
Unfortunately checking or unchecking the release checkbox and such did not fix it for me. It turns out it was an issue with my GooglePlayGamesPluginDependencies.xml causing my ExternalDependencyManager to fail resolution. This answer fixed the issue for me! |
gonna try it tomorrow, it is very frustrating to see lot of route errors in this plugin, not only in this version :( somebody knows something about Unity only supports until 10.14 version of plugin? |
Just to clarify about proguard setup. |
I don't know to be honest. I figured it's to both keep file size down and keep your code better hidden from decompiling / cheat software. But I'm really not sure. |
Hi, I found a solution.
Then copy the contents of "Assets\GooglePlayGames\com.google.play.games\Proguard\games.txt" below the line above. If the above is packaged, the game running process reports an error: "requires the Google Play Store, but it is missing."
According to the document, after Android 11, if you need to access other applications, you need to declare it first. Then I checked the package names of Google Game Services, Google Store, and Google Play on the phone. Then fill it in, because I'm not sure which one is useful and which one doesn't, the safest is to write them all. For me this works. I've been stuck in this place for three days... This is my file content. proguard-user.txt↓↓↓↓↓↓
AndroidManifest.xml↓↓↓↓↓↓
|
everything above is not working, but then I update External Dependency to newest version, then it works. |
I used the Unity: v2022.1.24f1 Build setting proguard-user.txt-keep class com.google.android.gms.games.PlayGames { *; }
-keep class com.google.android.gms.games.leaderboard.** { *; }
-keep class com.google.android.gms.games.snapshot.** { *; }
-keep class com.google.android.gms.games.achievement.** { *; }
-keep class com.google.android.gms.games.event.** { *; }
-keep class com.google.android.gms.games.stats.** { *; }
-keep class com.google.android.gms.games.* { *; }
-keep class com.google.android.gms.common.api.ResultCallback { *; }
-keep class com.google.android.gms.signin.** { *; }
-keep class com.google.android.gms.dynamic.** { *; }
-keep class com.google.android.gms.dynamite.** { *; }
-keep class com.google.android.gms.tasks.** { *; }
-keep class com.google.android.gms.security.** { *; }
-keep class com.google.android.gms.base.** { *; }
-keep class com.google.android.gms.actions.** { *; }
-keep class com.google.games.bridge.** { *; }
-keep class com.google.android.gms.common.ConnectionResult { *; }
-keep class com.google.android.gms.common.GooglePlayServicesUtil { *; }
-keep class com.google.android.gms.common.api.** { *; }
-keep class com.google.android.gms.common.data.DataBufferUtils { *; }
-keep class com.google.android.gms.nearby.** { *; }
P.S I will try with other build settings and update comment |
Upgrade External Dependency Manager was issue for me https://github.com/googlesamples/unity-jar-resolver/releases/tag/v1.2.176 Unity: v2022.3.7f1 proguard-user.txt:
|
Hello everyone, my problem was the same and it was solved when I forced to resolve the dependencies for Android, it also worked when I only resolved dependencies. I did it like this: Assets > ExternalDependencyManager > AndroidResolver > Force Resolve or Assets > ExternalDependencyManager > AndroidResolver > Resolve. |
Just Update progard.txt file under project setting below -keep class com.google.android.gms.games.PlayGames { ; } this will solve this error for me but then i can't show leaderboardUI show error for this you have to add below line after authentication this will show leaderboard pop up also when hit leaderboard show button |
Another variation: With the solution described by suchiz, ... ignoring that they are still using Packages in the path. I've only updated the one file, GooglePlayGamesPluginDependencies.xml with: Assets/GooglePlayGames/com.google.play.games/Editor/m2repository Note that the Local Maven Repo Directory button is within the Android Resolver Settings. Unity 2022.3.2 EDIT #1: no progard, and debug minify authenticating with: PlayGamesPlatform.Instance.Authenticate() EDIT #2: I had regression while making other edits, so I thought I'd add some detail to help debug. If Assets\GeneratedLocalRepo\GooglePlayGames does not exist, GooglePlayGamesPluginDependencies.xml may be in error. Once updated, 'Force Resolve' will build this directory. I did have the problem that something in \MyProject\Library was continually rewriting the .XML with the default/erroneous config. I'll look closer next time but I deleted the Library folder altogether without trouble (I needed to reselect Android as a platform but that was all that was lost.) |
I think you have to change your custom progard file and also minify on when
build
…On Thu, 28 Sept, 2023, 4:44 pm ScottyGav, ***@***.***> wrote:
Another variation:
This was my problem
<https://github.com/google/play-unity-plugins#play-core-library-conflicts>
With the solution described
<googlesamples/unity-jar-resolver#535> by
suchiz, ... ignoring that they are still using Packages in the path.
I've only updated the one file, GooglePlayGamesPluginDependencies.xml with:
Assets/GooglePlayGames/com.google.play.games/Editor/m2repository
Note that the *Local Maven Repo Directory* button is within the Android
Resolver Settings.
[image: image]
<https://user-images.githubusercontent.com/7378655/271262404-cf4faf51-bc5e-4257-93a3-efb7726e3fbf.png>
Unity 2022.3.2
google-signin-plugin-1.0.4.unitypackage
GooglePlayGamesPlugin-0.11.01.unitypackage
external-dependency-manager-1.2.176.unitypackage
—
Reply to this email directly, view it on GitHub
<#3154 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BA4A3NZLVC6FWQGN6OFI563X4VLZ3ANCNFSM5VZGGQDQ>
.
You are receiving this because you commented.Message ID:
<playgameservices/play-games-plugin-for-unity/issues/3154/1738948581@
github.com>
|
it works without it but will look at minify. I'll update if it breaks. |
Im having no luck, this happens only if I have both this plugin and the AdMob one at the same time, otherwise they work fine individually |
Update your resolve
Then try force resolve successfully
Also you have to update manually your proguard.txt file
Maybe it will work
…On Mon, 2 Oct, 2023, 9:00 am Cristian Juarez, ***@***.***> wrote:
Im having no luck, this happens only if I have both this plugin and the
AdMob one at the same time, otherwise they work fine individually
—
Reply to this email directly, view it on GitHub
<#3154 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BA4A3N3DKC2TTWM53OLL3ITX5IYOHANCNFSM5VZGGQDQ>
.
You are receiving this because you commented.Message ID:
<playgameservices/play-games-plugin-for-unity/issues/3154/1742354852@
github.com>
|
thank you, @restush - really works this! |
Hi I tried to change this line of code in GooglePlayGamesPluginDependencies.xml form this |
I have nothing to add. Just wanted to say that this worked for me, and was a huge relief. Have been trying to get this working for ages. Thank you so much!!! |
This from @rafalkasa is what solves it for me. Thanks! |
I just wanted to chime in and add that I was upgrading from a 2014 build (very ancient) and had these same issues. I've been trying different things for a few weeks in between refactoring the UI. Everyone who recommended to use the "force resolve external dependencies" has my eternal gratitude! Seeing that play leaderboard and achievements list working for the first time in years is fantastic. |
I configured everything in the right way, it's been days I am following the documentations, looking for answers and trying with different solutions building each time a new app.
Even if I'm pretty sure everything is fine, I still have one last issue before making this plugin working. I can't believe how difficult it is. To summarize:
But nothing helped.
As soon as I try to call PlayGamesPlatform methods from my app the error java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames occurs.
Is it a bug? What else can I try? I really don't know what else I can do.
Thank you for the help.
The text was updated successfully, but these errors were encountered: