Why cannot I distribute my app in Visual Studio 2017?

Fellow developers,

I'm having a lot of troubles distributing my newest update for Android with Visual Studio 2017 Community Edition 15.4.2, I'm getting this error:
Google Play Store: Authorize
The type initializer for 'Google.Apis.Json.NetwonsoftJsonSerializer' threw an exception.

I cannot see the error and I'm just using the JSON.NET library for reading the Wikipedia API, do you have an additional option for deserializing the JSON to Object?

I tried this option longtime ago, but it didn't work:
var facebookFriends = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize(json);

Currently, I'm targeting Android 8.0 and the minimum is 4.2, it was working perfectly a couple of months ago, but right now that I want to perform an update, I cannot go further. Does anyone have any idea what is going on? I'm using JSON.NET and it seems the bug has a connection, but I don't know what, I already uninstalled, reinstalled and updated all packages. Thanks for your help.

Answers

  • 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.

    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

Sign In or Register to comment.