iOS Extension Widget failing when using Newtonsoft.Json package

ramonesteban78ramonesteban78 ESUniversity ✭✭

Hi all,

Are you guys having issues with the last stable version of Visual Studio for Mac with Newtonsoft.Json package?

I have an extension project (Home widget), and everything seems to be ok on simulator, but as soon as I try to debug in my physical device, the widget is not able to load when I'm using JsonConvert.DeserializeObject. It doesn't throw an exception, just the debugger closes the connection and nothing is registered in the device log.

c# var settings = JsonConvert.DeserializeObject<Watch_Settings>(json);

This was working before with previous versions of Visual Studio for Mac. This is my version:

=== Visual Studio Enterprise 2017 for Mac ===

Version 7.5.2 (build 40)
Installation UUID: f1d64277-592e-4ad5-ab6f-f67e534b0e96
Runtime:
Mono 5.10.1.57 (2017-12/ea8a24b1bbf) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)

Package version: 510010057

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.1.0-preview1-26216-03
2.0.5
2.0.0
SDK: /usr/local/share/dotnet/sdk/2.1.300-preview1-008174/Sdks
SDK Versions:
2.1.300-preview1-008174
2.1.4
2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.2
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 9.4 (14160)
Build 9F1027a

=== Xamarin.Mac ===

Version: 4.4.1.193 (Visual Studio Enterprise)

=== Xamarin.Android ===

Version: 8.3.3.2 (Visual Studio Enterprise)
Android SDK: /Users/ren78/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
2.3 (API level 10)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.1 (API level 25)
8.0 (API level 26)
8.1 (API level 27)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 26.0.1
SDK Build Tools Version: 26.0.2

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.iOS ===

Version: 11.12.0.4 (Visual Studio Enterprise)
Hash: 64fece5f
Branch: d15-7
Build date: 2018-05-29 20:00:44-0400

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 705020040
Git revision: cfe2fc0566bc4db990242959de40505a13f58352
Build date: 2018-05-30 11:24:18-04
Xamarin addins: 3ac7413ef51a88e06367313c27aec8f7292752a6
Build lane: monodevelop-lion-d15-7

=== Operating System ===

Mac OS X 10.13.3
Darwin 17.4.0 Darwin Kernel Version 17.4.0
Sun Dec 17 09:19:54 PST 2017
root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

LiveXAML 1.3.31
xUnit.NET 2 testing framework support 0.7.5
Internet of Things (IoT) development (Preview) 7.5

Is there someone out there with similar issues?

Thanks in advance.
Regards

Posts

  • diegoxleondiegoxleon ESMember ✭✭

    I had this problem as well. Don´t know the reason exactly but it worked with System.Json:

    var json = JsonValue.Parse(jsonstring);
    var data = json["property"];
    
  • ramonesteban78ramonesteban78 ESUniversity ✭✭

    Thanks @diegoxleon , I will try your solution.

Sign In or Register to comment.