I'm trying to integrate Google Play Games Services into my android game for a high score leaderboard. I followed the quickstart guide [1] and the documentation on sign in [2].
What is stated there is that the sign in happens automatically. The only thing required is to initialize the SDK via PlayGamesSdk.initialize(activity);
in the OnCreated
handler of the main activity.
This is also my experience when using other games. I get a prompt to sign in using the play games account.
However what happens with my game is I get an Exception followed by a crash:
android.content.ActivityNotFoundException: Unable to find explicit activity class {org.mygame.android/com.google.android.gms.games.internal.v2.resolution.GamesResolutionActivity}; have you declared this activity in your AndroidManifest.xml?
I can't find any info about that. What am I missing?
Note: if I use the Play Games app to manually sign-in for my game before starting it, everything works: I can query the sign-in status, user-id and show the leaderboard without problems.
The solution is to add the following snippet to the AndroidManifest.xml file
<activity
android:name="com.google.android.gms.games.internal.v2.resolution.GamesResolutionActivity"
android:exported="false">
</activity>