playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.43k stars 954 forks source link

Upgrading from Unity 2021.16f1 to Unity 2021.2.0b16 makes Google Play Services not login correctly #3083

Closed Zepir closed 2 years ago

Zepir commented 2 years ago

Hey, so I upgraded from Unity 2021.16f1 to Unity 2021.2.0b16 and Google Play Services stopped logging in correctly, giving the error "Setting result error status code to: 16" on Android Logcat. I downgraded back to 2021.16f1, and changed nothing else and everything works fine, but I really needed it to work on Unity 2021.2+ because of new features.

The "Connecting to Play Services" at the top doesn't even appear, just a split second of the screen turning black when I click login.

I'm also using Cloud Once plugin, it provides a unified game services API for Google Play Game Services and Apple Game Center, but it doesn't seem to be the problem.

Zepir commented 2 years ago

I fixed it by going to Project Settings -> Player -> Publishing Settings - Build and checking the "Custom Main Manifest" on. Then edit the Assets\Plugins\Android\AndroidManifest.xml to add the APP ID. Something in Unity 2021.2+ must have changed how the AndroidManifest is read, I had it in another folder and it always worked.

haru-sudo commented 2 years ago

@Zepir Hi. How do I edit Assets \ Plugins \ Android \ AndroidManifest.xml to add the APPID? Please.

Zepir commented 2 years ago

Insert the line <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\u003YOUR_APP_ID" /> inside the manifest, be sure to put "\u003" before the ID.