Cannot authorize Xamarin to access Google Play account

2»

Posts

  • dh41235dh41235 ATMember ✭✭

    I still have the problem VS 15.7.2

  • dh41235dh41235 ATMember ✭✭

    I still have the problem VS 15.7.2

  • TommyOvesenTommyOvesen USMember ✭✭
    edited July 2018

    Had it too suddenly. When uploading APK manually it seems I got some warnings there for my APK. Maybe that has to do with it.

  • HerculesObieHerculesObie Member ✭✭

    I have the same problem:
    Using VS2017 Enterprise v 12.7.5
    I have published before to Google Play Store (last time was 22 June 2018) and all went fine.
    Had to re-install PC, VS2017 and all apps and now when I try to Distribute my updated App to Play Store I get the same message.

    Steps on VS2017:
    1. Right Click Solution, Select Archive All...
    2. After Compilation click on [Distribute ...]
    3. Click on [Google Play]
    4. Select 'Signing Identity', click [Continue]
    5. Click [+] to add 'Google Play Accounts'
    6. On 'Register Google API Access' page enter 'Account Description', 'Client Id', 'Client Secret' and click [Register]
    7. Web Browser opens up and asks me to login with my Google Play Developer Account, and I click Log in.
    8. On the 'Sign in with Google' page I click [Allow].
    9. The Web page then goes to a '127.0.0.1:49974' (Chrome) or '127.0.0.1:50008' (Internet Explorer) page and says: "This site cant be reached".
    10. At the same time VS2017 reports on the 'Register Google API Access' page:
    "Google Play Store: Authorize: The type initializer for 'Google.Apis.Json.NewtonsoftJsonSerializer' threw an exce"
    The rest of the message is cut off. (Xamarin Log File at bottom)

    I have tried Authentication with both Chrome and Internet Explorer.

    My App uses:
    Newtonsoft.Json v11.0.2
    Xamarin.Forms v 2.5.1.527436
    Xamarin.Android.Support.v4 v25.4.0.2
    Xamarin.Android.Support.Design v25.4.0.2
    Xamarin.Android.Support.v7.AppCompat v25.4.0.2
    Xamarin.Android.Support.v7.RecyclerView v25.4.0.2

    As well as:
    Mono.Android v4.0.30319
    System
    System.Core
    System.Net.Http
    System.Xml
    System.Xml.Linq

    Compile using Android version: Android 8.1 (Oreo)
    Minimum Android version: Android 6.0
    Target Android version: Android 7.1


    From the Xamarin Log file it seems (as suggested elsewhere) that I need Newtonsoft.Json, Version=10.0.0.0.
    However I cant find this version anywhere!!

    Downloaded latest and v10.0.0.1 but still same error.

    Xamarin Log File:
    Xamarin.VisualStudio.Publishing.Presentation.ViewModels.GooglePlayRegisterViewModel|Information|0|Google Play Store: Authorize
    System.TypeInitializationException: The type initializer for 'Google.Apis.Json.NewtonsoftJsonSerializer' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
    at Google.Apis.Json.NewtonsoftJsonSerializer..ctor()
    at Google.Apis.Json.NewtonsoftJsonSerializer..cctor()
    --- End of inner exception stack trace ---
    at Google.Apis.Json.NewtonsoftJsonSerializer.get_Instance()
    at Google.Apis.Auth.OAuth2.Requests.TokenRequestExtenstions.d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.d__35.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.AuthorizationCodeInstalledApp.d__8.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.d__4.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Xamarin.Ide.Google.GooglePlayStore.d__5.MoveNext() in E:\A_work\7\s\src\Core\Xamarin.VisualStudio.Google\GooglePlayStore.cs:line 52

  • HerculesObieHerculesObie Member ✭✭

    I have the same problem:
    Using VS2017 Enterprise v 12.7.5
    I have published before to Google Play Store (last time was 22 June 2018) and all went fine.
    Had to re-install PC, VS2017 and all apps and now when I try to Distribute my updated App to Play Store I get the same message.

    Steps on VS2017:
    1. Right Click Solution, Select Archive All...
    2. After Compilation click on [Distribute ...]
    3. Click on [Google Play]
    4. Select 'Signing Identity', click [Continue]
    5. Click [+] to add 'Google Play Accounts'
    6. On 'Register Google API Access' page enter 'Account Description', 'Client Id', 'Client Secret' and click [Register]
    7. Web Browser opens up and asks me to login with my Google Play Developer Account, and I click Log in.
    8. On the 'Sign in with Google' page I click [Allow].
    9. The Web page then goes to a '127.0.0.1:49974' (Chrome) or '127.0.0.1:50008' (Internet Explorer) page and says: "This site cant be reached".
    10. At the same time VS2017 reports on the 'Register Google API Access' page:
    "Google Play Store: Authorize: The type initializer for 'Google.Apis.Json.NewtonsoftJsonSerializer' threw an exce"
    The rest of the message is cut off. (Xamarin Log File at bottom)

    I have tried Authentication with both Chrome and Internet Explorer.

    My App uses:
    Newtonsoft.Json v11.0.2
    Xamarin.Forms v 2.5.1.527436
    Xamarin.Android.Support.v4 v25.4.0.2
    Xamarin.Android.Support.Design v25.4.0.2
    Xamarin.Android.Support.v7.AppCompat v25.4.0.2
    Xamarin.Android.Support.v7.RecyclerView v25.4.0.2

    As well as:
    Mono.Android v4.0.30319
    System
    System.Core
    System.Net.Http
    System.Xml
    System.Xml.Linq

    Compile using Android version: Android 8.1 (Oreo)
    Minimum Android version: Android 6.0
    Target Android version: Android 7.1


    From the Xamarin Log file it seems (as suggested elsewhere) that I need Newtonsoft.Json, Version=10.0.0.0.
    However I cant find this version anywhere!!

    Downloaded latest and v10.0.0.1 but still same error.

    Xamarin Log File:
    Xamarin.VisualStudio.Publishing.Presentation.ViewModels.GooglePlayRegisterViewModel|Information|0|Google Play Store: Authorize
    System.TypeInitializationException: The type initializer for 'Google.Apis.Json.NewtonsoftJsonSerializer' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
    at Google.Apis.Json.NewtonsoftJsonSerializer..ctor()
    at Google.Apis.Json.NewtonsoftJsonSerializer..cctor()
    --- End of inner exception stack trace ---
    at Google.Apis.Json.NewtonsoftJsonSerializer.get_Instance()
    at Google.Apis.Auth.OAuth2.Requests.TokenRequestExtenstions.d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.d__35.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.Flows.AuthorizationCodeFlow.d__30.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.AuthorizationCodeInstalledApp.d__8.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.d__4.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Google.Apis.Auth.OAuth2.GoogleWebAuthorizationBroker.d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
    at Xamarin.Ide.Google.GooglePlayStore.d__5.MoveNext() in E:\A_work\7\s\src\Core\Xamarin.VisualStudio.Google\GooglePlayStore.cs:line 52

  • Carl_JuneauCarl_Juneau Member ✭✭

    I have the same problem.

  • HerculesObieHerculesObie Member ✭✭

    The Solution provided by EliotG works.
    Thanks

  • JulieMJulieM Member

    I was able to workaround the problem by installing Newtonsoft.Json into the GAC using the following command:"c:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\x64\gacutil.exe" /i "d:\Development\Packages\newtonsoft.json\10.0.2\lib\net45\Newtonsoft.Json.dll"Open Command Prompt in Administrator mode and type above command line, replacing the folder where you save(ed) the NewtonSoft.Json.dllThen when you go back into Visual Studio you are able to use the "Distribute..." functionality.

  • JCCJCC ITMember ✭✭

    with the last visual studio update the problem has been solved

Sign In or Register to comment.