[Solved] HELP!, JsonConverters error when build and run in windows phone 8

Hi Aron,
I utilize A start pathfinding for my new game and it works fine on PC. However, when I build and run the project to my windows phone 8 device, I encounter errors at JsonConverters.cs file. The error detail is as follow:

Assets/Plugins/AstarPathfindingProject/Core/Serialization/JsonConverters.cs(5,33): error CS0234: The type or namespace name JsonFx' does not exist in the namespacePathfinding.Serialization’. Are you missing an assembly reference?
Assets/Plugins/AstarPathfindingProject/Core/Serialization/JsonConverters.cs(98,38): error CS0246: The type or namespace name JsonConverter' could not be found. Are you missing a using directive or an assembly reference? Assets/Plugins/AstarPathfindingProject/Core/Serialization/JsonConverters.cs(115,40): error CS0246: The type or namespace nameJsonConverter’ could not be found. Are you missing a using directive or an assembly reference?
Assets/Plugins/AstarPathfindingProject/Core/Serialization/JsonConverters.cs(148,40): error CS0246: The type or namespace name JsonConverter' could not be found. Are you missing a using directive or an assembly reference? Assets/Plugins/AstarPathfindingProject/Core/Serialization/JsonConverters.cs(173,43): error CS0246: The type or namespace nameJsonConverter’ could not be found. Are you missing a using directive or an assembly reference?
Assets/Plugins/AstarPathfindingProject/Core/Serialization/JsonConverters.cs(187,40): error CS0246: The type or namespace name JsonConverter' could not be found. Are you missing a using directive or an assembly reference? Assets/Plugins/AstarPathfindingProject/Core/Serialization/JsonConverters.cs(234,50): error CS0246: The type or namespace nameJsonConverter’ could not be found. Are you missing a using directive or an assembly reference?
Error building Player because scripts had compiler errors

I also google this problem and find an article about error of JsonConverters caused by the duplication of JsonFX.dll. However, in my project, there is only one Pathfinding.JsonFx.dll file.

My Unity version is: 4.5.2f1
I’m using Windows 8.1 Enterprise 64bit

Please, could you show me how to fix this?

Thanks!

Hi

It is really hard to support windows8/windows phone because of the weird changes microsoft decided to do to the .net library, it does not have full support yet, but I am working on it.

I have uploaded a new windows 8/windows phone beta here: http://arongranberg.com/astar/download if you could try it out that would be great.
Note that it currently only works with grid graphs and navmesh graphs.

Hi Aron,
It’s great when you have solution for my problem. However, your fix requires pro version of astar which cost $100. Meanwhile, I have no idea whether astar has any futher bugs on WP8 after buying pro version. As you mentioned about “Windows 8 beta version” of Astar, its only Beta and you cannot test it, so its hard for me to buy the solution that I’m not sure whether it works on my WP project.
My suggestion is the windows 8 beta version for Astar shouldn’t be charged, so WP developers like me can dig into, test it on our real projects and report bugs for you.
Thanks!

Hi

Ah, you are using the free version.
I usually just release a beta version for the users of the pro version, but that is mostly because sometimes beta versions contain features that I haven’t decided if they should be included in the free version or the pro version and it is generally easier for me just to release a single version, but I can upload a free version, it will be uploaded in a few minutes.

Windows Store and Windows Phone has been really annoying for a long time, see the sticky post: http://arongranberg.com/vanillaforums/discussion/509/unity-4-2-and-windows-8-windows-phone-8#latest

[Edit] Uploaded

Hi Aron, I really appreciate that the Windows 8 beta version is now available for free. I will try to test it out on my wp8 project and report any bugs to you. Hope that one day Astar for Windows phone 8 will be stable version, so it’s worth $100 or even more.

Hi Aron, I’ve tested your package in my project. When I build project to WP8, its great that my project no longer has error at JsonConverter during the “compile script” step. But, when the build process is nearly done, the project throws the following errors:

Error building Player: Exception: Error: method System.Type System.Type::GetInterface(System.String) doesn’t exist in target framework. It is referenced from Pathfinding.JsonFx.dll at System.Type Pathfinding.Serialization.JsonFx.JsonReader::GetGenericDictionaryType(System.Type).
Error: method System.Type System.Type::GetInterface(System.String) doesn’t exist in target framework. It is referenced from Pathfinding.JsonFx.dll at System.Void Pathfinding.Serialization.JsonFx.JsonReader::PopulateObject(System.Object&,System.Type,System.Collections.Generic.Dictionary2<System.String,System.Reflection.MemberInfo>,System.Type). Error: methodSystem.Type System.Type::GetInterface(System.String)doesn't exist in target framework. It is referenced from Pathfinding.JsonFx.dll at System.Void Pathfinding.Serialization.JsonFx.JsonWriter::Write(System.Object,System.Boolean). Error: methodSystem.Object System.Enum::ToObject(System.Type,System.UInt64)doesn't exist in target framework. It is referenced from Pathfinding.JsonFx.dll at System.Enum[] Pathfinding.Serialization.JsonFx.JsonWriter::GetFlagList(System.Type,System.Object). Error: typeSystem.ComponentModel.TypeDescriptordoesn't exist in target framework. It is referenced from Pathfinding.JsonFx.dll at System.Object Pathfinding.Serialization.JsonFx.TypeCoercionUtility::CoerceType(System.Type,System.Object). Error: methodSystem.ComponentModel.TypeConverter System.ComponentModel.TypeDescriptor::GetConverter(System.Type)doesn't exist in target framework. It is referenced from Pathfinding.JsonFx.dll at System.Object Pathfinding.Serialization.JsonFx.TypeCoercionUtility::CoerceType(System.Type,System.Object). Error: typeSystem.ComponentModel.TypeDescriptordoesn't exist in target framework. It is referenced from Pathfinding.JsonFx.dll at System.Object Pathfinding.Serialization.JsonFx.TypeCoercionUtility::CoerceType(System.Type,System.Object). Error: methodSystem.ComponentModel.TypeConverter System.ComponentModel.TypeDescriptor::GetConverter(System.Type)` doesn’t exist in target framework. It is referenced from Pathfinding.JsonFx.dll at System.Object Pathfinding.Serialization.JsonFx.TypeCoercionUtility::CoerceType(System.Type,System.Object).


I also scan the Pathfinding.Serialization.JsonFx.dll file (version:1.4.1003.3008) in directory: “AstarPathfindingProject/Plugins/JsonFx” and the result seems to match the above errors with the incompatibility at: Type Type.GetInterface (string); TypeConverter TypeDescriptor.GetConverter (System.Type); object Enum.ToObject (Type, ulong)

The link of scan result: http://scan.xamarin.com/Home/Report?scanId=9ae0c992-191f-413d-91d2-27a71fd0931e

Thanks!

Hi

Try to delete the AstarPathfindingProject folder and import it again, the JsonFX dll should not be included in the build (in that version it has been completely stripped out from the project, you can see this if you go to AstarPathfindingProject/Plugins/JsonFx, it should have a dll.x extension instead of a .dll extension).

Hi Aron, my false. Thank to your instruction, I kept dll.x files, deleted .dll files in AstarPathfindingProject/Plugins/JsonFx folder and now the project with pathfinding works well on my WP8 device. I’m exploring Astar’s APIs further on WP8, so if there are any other bugs, I’ll report to you.
Thanks for your help!

Awesome!

Have you tried verifying the application against the windows store validation process (I don’t know exactly what it is called)?

The validation of Windows phone and windows store is WACK. I’ll test it and let you know soon.

Hi Aron, I’ve test my project which including Astar pathfinding via WACK and the result is PASS. However, if anybody fail WACK at : “The Debug Configuration Test”, the workaround is updating new dll of Unity at this thread: http://forum.unity3d.com/threads/this-problem-really-needs-a-solution-case-619196.256598/ (by Tomas 1856). This new dll did fix the problem of my previous game.
This bug exists at version 4.5.2f1 of Unity, but Unity promises me that they will fix this at the next version.

Awesome!