encountered an error in a game I’ve been working on for a long time, and unfortunately the solutions I searched on “Google” didn’t work or I couldn’t manage it.
about the problem;
The game somehow cannot connect to the “android games platform”. The interesting thing is that if I build the game in development mode, I do not experience any problems, it works perfectly fine. but if I configure it in release mode the game will run "PlayGamesPlatform.Activate();"
It gets stuck in its code and does not continue.
So how do I know this: When I replace this code, the previous codes work.
As for detailed information:
The Unity version I use is: 2022.3.5f1.
The error I get from android logcat:
- AndroidJavaException: java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames,
- Unity java.lang.ClassNotFoundException: com.google.android.gms.games.PlayGames,
- Error Unity at java.lang.Class.classForName(Native Method).
etc…
Part of the code I wrote:
public void Start()
{
StartCoroutine(FirstDoorsOpening()); // this is the game opening
}
IEnumerator FirstDoorsOpening()
{
yield return new WaitForSeconds(0.8f);
PlayGamesPlatform.Activate(); // This was normally at the start
yield return new WaitForSeconds(0.4f);
SignIn();
}
public void SignIn()
{
PlayGamesPlatform.Instance.Authenticate(ProcessAuthentication);
}
internal void ProcessAuthentication(SignInStatus status)
{
if (status == SignInStatus.Success)
{
AuthenticationSuccess();
}
else
{
detailsText_Negative.text = "SIGN IN FAILED PLEASE CHECK YOUR CONNECTION";
}
}
void AuthenticationSuccess()
{
StartCoroutine(GotoFirstScene());
}
Other details you may need:
Google play games plugin dependencies: <repository>Assets/GooglePlayGames/com.google.play.games/Editor/m2repository</repository>
strip
If there is any other detail you would like, please let me know.
Hasan Alkan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.