Cannot register my Xamarin forms app using the visual studio distribute function.

Wout Ongena 276 Reputation points
2021-11-24T15:54:36.69+00:00

When I try and follow the follow guide https://learn.microsoft.com/nl-nl/xamarin/android/deploy-test/publishing/publishing-to-google-play/?tabs=windows I come to the point where I Register my google api access. The guide presses the button to create a new Client ID, but that no longer works so I have to go to the google cloud platform and create one myself, when I do that I choose a web app Client ID. After I enter the credentials in the Visual studio distribution window I get a Fout 400: redirect_uri_mismatch error:
152334-image.png

Then I enter this URL into my client allowed redirect url list:
152307-image.png

and when I try to register again I get the same error because visual studio has used a new port.
Is there any way to fix this or tell visual studio to use a certain port?

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

Accepted answer
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 36,436 Reputation points Microsoft External Staff
    2021-11-25T03:11:27.097+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    when I do that I choose a web app Client ID.

    I'm afraid the Application type is Desktop not Web App. You could try to create a new Client ID which Application type is Desktop.
    I test it by selecting Desktop, it wroks, you could have a try.

    For more information, you can refer to
    https://developers.google.com/identity/protocols/oauth2/native-app#android
    https://stackoverflow.com/questions/64576758/error-400-redirect-uri-mismatch-when-distributing-xamarin-forms-app

    ----------------
    update--------------
    Google has been fairly consistently changing the oauth configuration workflow. For this Error 403: access_denied you have to add your account as a test user which will allow you to authorize. You can do it like this : ** Go to your Goole developer console, click Users and permissions, then add the user for App permissions and Account permissions. **
    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.