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

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


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source