Search code examples
xamarin.formsxamarin.androidvisual-studio-2019google-developers-consolegoogle-play-developer-api

Error 400: redirect_uri_mismatch when distributing Xamarin Forms App


I am trying to distribute my Xamarin Forms Android app via the Google Play Store in Visual Studio 2019.

I follow this tutorial by Microsoft: https://learn.microsoft.com/en-us/xamarin/android/deploy-test/publishing/publishing-to-google-play/?tabs=windows

I went through the steps of setting up a Google Developer Account as well as creating an application in the google dev console and an OAuth2 client.

I then entered the Client ID and Client Secret into the form and tried to register. Instead of being forwarded to the authorization page, I saw this error: Error 400: redirect_uri_mismatch

Unfortunately, I cannot just add the uri to the OAuth2 client, as the port changes every time I try to register button.

So, how can I solve this issue? Can I somehow fix the port that Visual Studio/Xamarin Forms uses? Is there an entirely different approach?

Your help is greatly appreciated.


Solution

  • you need to create a Desktop App credential not a Web App in order to register from Visual Studio