play-games-plugin-for-unity icon indicating copy to clipboard operation
play-games-plugin-for-unity copied to clipboard

Authentication fail: Returning error code, result: DeveloperError

Open LeonardoDaLuz opened this issue 2 years ago • 16 comments

I've tried everything, I've checked sha-1, I've configured and reconfigured everything and nothing. I am desperate. I'm on the third day trying to make this work.

It only worked 1 time, then it didn't work anymore.

It's always returning: "returning error code" and "DeveloperError".

Google not even to give feedback on the cause of the error. I am traumatized by this bureaucratic company.

Version 0.10.14 here.

LeonardoDaLuz avatar Jan 05 '22 22:01 LeonardoDaLuz

Hi Leonardo,

Can you please create a bug report (https://developer.android.com/studio/debug/bug-report)?

Thanks

eantaev avatar Jan 06 '22 20:01 eantaev

Same. Using 0.10.14.

i-miss-old-mmorpg avatar Jan 10 '22 12:01 i-miss-old-mmorpg

Greetings! I started having the same issue for a couple of days now. We already have a published version of the game on Play Store which has been working since launch and still is today, so I definitely know that I done the settings properly.

Unity Version: 2020.3.19f1 GPGS Plugin Version 0.10.12 (also tried 0.10.14)

Tests I've done and their results:

  • Debug key, development build, USB build => AUTH SUCCESS (normal behavior)
  • Debug key, production build, USB build => AUTH FAILED, NOTHING HAPPENS (+ no Debug)
  • Upload key, development build, USB build => AUTH CANCELLED, but a loading circle is shown for a couple of seconds on the middle of the screen
  • Upload key, production build, Play Store (Internal AND Closed tracks) => AUTH FAILED / CANCELLED (no Debug)
  • Upload key, production build, Play Store (Production track, last updated in December 2021) => AUTH SUCCESS.

The USB tests were performed on physical devices, (Android 7.1.1, Android 10, Android 11), while the Play Store Internal and Closed track tests also added emulated devices with Android versions 8, 9 and 12.

Things I checked:

  • Setup of SHA1 keys in Cloud Console and Play Games Console configuration (Upload key, Google private key and my machine's debug key)
  • Status of the Anti-Piracy setting for each key (was enabled for Upload key, but I disabled it to test for changes).

Note:

  • Before this week, I was able to install via USB any of the first 3 mentioned test cases from above and the GPGS Auth was working as expected.

Other tests I'll try after writing this:

  • Disable Minify
  • Disable Symbols creation
  • Disable custom Main Manifest (it is made custom for the "android:exported" requirement that also started appearing for us as of this week, when targeting Android 12 devices)
  • Install newer Unity version
  • Install newer GPGS plugins

Any help would be greatly appreciated!

===== EDIT

Disabling Minify, Symbol creation and the custom manifest did not help at all. I also tried changing the minimum API from 25 (which I planned to add support to for the next update) back to API 30 (which is the lowest available one in Production right now). None of these methods worked. Proceeding to update my tools.

mihaigonciar avatar Jan 14 '22 09:01 mihaigonciar

Use the web api client id and not the regular client ids.

benk0913 avatar Jan 17 '22 20:01 benk0913

I've tried everything, I've checked sha-1, I've configured and reconfigured everything and nothing. I am desperate. I'm on the third day trying to make this work.

It only worked 1 time, then it didn't work anymore.

It's always returning: "returning error code" and "DeveloperError".

Google not even to give feedback on the cause of the error. I am traumatized by this bureaucratic company.

Version 0.10.14 here.

Same here (with Unity 2019.4.30f1), we started the integration last week and everything is now blocked because of this issue. I was using version 0.10.13 as it was the latest release tagged, thanks to you I just discovered that 0.10.14 is available, I just updated and I will check but looking at all these replies I am afraid this won't be solved.

As a side note, after upgrading to 0.10.14 I launched again the setup (Window => Google Play Games => Setup => Android Setup => Setup button), I see on GIT one specific change that makes me think that there is something wrong in the generation of some files. image The new path is clearly wrong. I am instead fixing it manually with: image

Tanek81 avatar Jan 18 '22 18:01 Tanek81

Hi @Tanek81. You can use v10.12 safely as you have Unity 2019.4.30f1. V10.12 has proved itself to be stable as many games using it are currently in prod and have many users for a while. Just make sure that you delete all folders about GooglePlayGames, including Plugins/Android and then import the plugin. If you still have problems, it is likely that there is configuration issues somewhere else.

To give you more context on the updates since v10.12, the way Unity detects a directory as an Android Library has changed with Unity 2020. See 1 and 2. We changed the directory of the manifest file, so it would be detected as an Android library by Unity versions both >=2020 and <2020. V10.13 does not work for Unity versions before 2020, so I now removed it from the releases list.

V10.14 should work for all versions when imported correctly. I will be actively looking into this until the end of Friday. Try it with v10.12 and v10.14(by removing all GPG folders first) and let me know if you still have the issue. When you have questions, please attach a bug report if you have the issue and a screenshot of the project structure and whether you see the app_id field in the manifest file of the apk.

ozdemir08 avatar Jan 19 '22 15:01 ozdemir08

Also, please take a look at the last comments in https://github.com/playgameservices/play-games-plugin-for-unity/issues/3091.

ozdemir08 avatar Jan 19 '22 15:01 ozdemir08

Thank you for your detailed explaination! Before trying with a downgrade, I have imported the "new" 0.10.14 (the one you just tagged today) which is slightly newer that the one that was available earlier (but I don't see any changes from the earlier one). I am going to test it right now in Internal Testing track to see if everything is fixed. For now I can tell you that the strange/wrong change I reported above in the generation of "\Assets\GooglePlayGames\Editor\GooglePlayGamesPlugin_v0.10.14.txt" is still happening when launching the setup.

Tanek81 avatar Jan 19 '22 16:01 Tanek81

Thanks for checking that.

Please make sure that you delete GooglePlayGames and Plugins/Android folders and after that import v10.14. Also, could you give more detail about Assets\GooglePlayGames\Editor\GooglePlayGamesPlugin_v0.10.14.txt and your comment above? What is exactly unexpected for you? The more detail, the more helpful it will be for us.

ozdemir08 avatar Jan 19 '22 16:01 ozdemir08

Following the comments in https://github.com/playgameservices/play-games-plugin-for-unity/issues/3091 I checked in the AAB and the APP_ID is missing in the manifest, so that's not a build I will upload in Internal Tests track. I'll dig more into this to understand why this isn't being added.

Regarding my earlier comment, if you see the first screenshot the setup is changing the project.properties path with: "Assets/GooglePlayGames/anifest.androidlib/project.properties" Which is clearly wrong because:

  1. "GooglePlayGames/anifest.androidlib" should instead be "GooglePlayGamesManifest.androidlib";
  2. the correct path is "Assets/GooglePlayGames/Plugins/Android/GooglePlayGamesManifest.androidlib/project.properties" That's why I did the second change manually.

Also, looking at the last commit (https://github.com/playgameservices/play-games-plugin-for-unity/commit/77339a93583ab0a38c1d4312f0e6a6de6d723156) before the 0.10.14 was tagged, I saw that in your build.gradle you are referencing:

implementation 'com.google.android.gms:play-services-games:22.0.1'
implementation 'com.google.android.gms:play-services-auth:20.0.1'
implementation 'com.google.android.gms:play-services-nearby:18.0.2'

But in the plugin POM we still have:

<dependency>
      <groupId>com.google.android.gms</groupId>
      <artifactId>play-services-games</artifactId>
      <version>21.0.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.android.gms</groupId>
      <artifactId>play-services-auth</artifactId>
      <version>19.2.0</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>com.google.android.gms</groupId>
      <artifactId>play-services-nearby</artifactId>
      <version>18.0.0</version>
      <scope>compile</scope>
</dependency>

These should be updated, am I correct?

Tanek81 avatar Jan 19 '22 17:01 Tanek81

New build has now app_id and login is working in Internal Tests track :) (Edit for clarity: my Unity version is 2019.4.30f1)

What I did:

  1. Updated to plugin version 0.10.14 (as @ozdemir08 said the 0.10.13 should not be used with Unity < 2020)
  2. Double checked the exact position of project.properties which is "Assets\Plugins\Android\GooglePlayGamesManifest.androidlib". I was wrong in my earlier reply, that path was left from the 0.10.13 version and should be deleted as always when updating. Still, the setup is setting a wrong path in the txt.
  3. Manually updated the POM ( "Assets\GooglePlayGames\Editor\m2repository\com\google\games\gpgs-plugin-support\0.10.14\gpgs-plugin-support-0.10.14.pom") to reflect latest dependencies changes in the project.
  4. Manually fixed the generated "Assets\GooglePlayGames\Editor\GooglePlayGamesPlugin_v0.10.14.txt" using the correct path
  5. Created a new build checking for app_id in the Manifest to be sure about that as that's mandatory for a correct implementation.

I don't think 4. is mandatory, but 3. instead should be fixed as that's including old dependencies. I hope this can help.

Tanek81 avatar Jan 19 '22 18:01 Tanek81

1 week and 16 build attempts later... Your solution, along with a bunch of gradle corrections, and authentication is now working! Much thanks for posting @Tanek81 I'm using Unity 2020.3.25 Plugin 0.10.14 Target API 32 Updated "Assets\GooglePlayGames\Editor\m2repository\com\google\games\gpgs-plugin-support\0.10.14\gpgs-plugin-support-0.10.14.pom" to latest versions which can be found here: https://developers.google.com/android/guides/setup#list-dependencies or in Tanek81's post above. I also corrected "Assets\GooglePlayGames\Editor\GooglePlayGamesPlugin_v0.10.14.txt" using the path "Assets\Plugins\Android\GooglePlayGamesManifest.androidlib" -Tanek81 said this may be a redundant step. That file is referenced in settings.gradle once it's corrected.
After those fixes, I had to export the project from unity and in android studio, in the project-level build.gradle update jcenter() to mavenCentral() and classpath 'com.android.tools.build:gradle:4.0.2'

TailwagDeveloper avatar Jan 24 '22 19:01 TailwagDeveloper

After #3091 was closed i'm here again cause in my new project with 0.10.14 services not work again! When this bug will be fixed?

Also maybe anyone know which of SHA i should use in Cloud Google Console? From Certificate for Application Signing Key or Boot Key Certificate? Try both but first work only once...

UPD: Sorry. In my second app same error. I found this bug with LogCat. 2022-02-03 15:46:25.562 19737-19780/? E/SignInRequest: Web client ID is needed for Auth Code 2022-02-03 15:46:25.562 19737-19780/? E/SignInRequest: Setting result error status code to: 10

Don't use

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().Build(); PlayGamesPlatform.InitializeInstance(config);

use only PlayGamesPlatform.Activate(); as i mentioned in #3091

DimaDDM avatar Feb 02 '22 20:02 DimaDDM

I've tried everything, I've checked sha-1, I've configured and reconfigured everything and nothing. I am desperate. I'm on the third day trying to make this work. It only worked 1 time, then it didn't work anymore. It's always returning: "returning error code" and "DeveloperError". Google not even to give feedback on the cause of the error. I am traumatized by this bureaucratic company. Version 0.10.14 here.

Same here (with Unity 2019.4.30f1), we started the integration last week and everything is now blocked because of this issue. I was using version 0.10.13 as it was the latest release tagged, thanks to you I just discovered that 0.10.14 is available, I just updated and I will check but looking at all these replies I am afraid this won't be solved.

As a side note, after upgrading to 0.10.14 I launched again the setup (Window => Google Play Games => Setup => Android Setup => Setup button), I see on GIT one specific change that makes me think that there is something wrong in the generation of some files. image The new path is clearly wrong. I am instead fixing it manually with: image

Thanks a lot @Tanek81 Your solution worked for me

rohitvishwakarma1819 avatar Mar 16 '22 14:03 rohitvishwakarma1819

Use the web api client id and not the regular client ids. This answer helped me. if you need server verify id token,please use the web client id.

simpletuo avatar Mar 17 '22 02:03 simpletuo

Use the web api client id and not the regular client ids. This answer helped me. if you need server verify id token,please use the web client id.

This means (probably) creating a new OAuth client ID Credential in Google Cloud Platform with application type set to Web application. Then use the client id from it. Tested on debug usb build and it finally works!

MichalMarshallek avatar Mar 20 '22 22:03 MichalMarshallek