Adding Google Play to Unity Project -> java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames
Asked Answered
G

1

6

I have a Unity 2020.3.32f1 game and need to fix Google Play login. I upgraded to 0.11.1

Now I get an exception

AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames

when I try to init the library

   public GooglePlayService()
   {
       InitStatus = InitStatus.NotInitialized;
       LoginStatus = LoginStatus.NotLoggedIn;
       PlayGamesPlatform.DebugLogEnabled = true;
       PlayGamesPlatform.Activate();
       Log("PlayGamesPlatform.Activated");
   }

Following their instructions on adding Proguard and minify did not help.

I am a bit of an Android noob so it's probably something basic.

Notes:

  • I ran the Android dependency resolver.
  • Minify is turned on for release
  • Min API Level 19
  • Target API level 30
  • I am using the internal build system
  • No strange characters in my project path
Galliett answered 18/4, 2022 at 16:12 Comment(1)
Hi, did you or anyone solve this?Limeade
P
0

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

Puffin answered 15/12, 2023 at 19:44 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Funke

© 2022 - 2025 — McMap. All rights reserved.