Trying to use this with Hololens [solved]

Running into this issue:

Assets\AstarPathfindingProject\Core\Serialization\TinyJson.cs(219,18): error CS1929: ‘TypeInfo’ does not contain a definition for ‘GetField’ and the best extension method overload ‘ReflectionExtensions.GetField(Type, string)’ requires a receiver of type ‘Type’

Its throwing errors on all the serialization scripts.

Will it possible to get this to work?

Chuck

To add a little more info I’m using 5.5f3.

Chuck

Hi

Ah, looks like some incompatibility with that specific version of .Net.
I don’t use Windows myself so it is hard for me to test it. I thought I had avoided all those cases, but apparently not.
I’m not really sure why that error is thrown however since according to the documentation it should exist even for newer versions of .Net. Do you think you could try changing that line from

var field = tpInfo.GetField(name);

to

var field = tp.GetField(name);

and see if that works?

I’m getting the same problem. I’m trying to build to Windows 10 (UWP). By changing the line above other errors occur.

Assets\AstarPathfindingProject\Core\Serialization\JsonSerializer.cs(864,34): error CS1061: ‘Type’ does not contain a definition for ‘Assembly’ and no extension method ‘Assembly’ accepting a first argument of type ‘Type’ could be found (are you missing a using directive or an assembly reference?)

Assets\AstarPathfindingProject\Core\Serialization\TinyJson.cs(46,32): error CS1503: Argument 1: cannot convert from ‘System.Reflection.TypeInfo’ to ‘System.Type’

Assets\AstarPathfindingProject\Core\Serialization\TinyJson.cs(62,17): error CS1929: ‘TypeInfo’ does not contain a definition for ‘GetCustomAttributes’ and the best extension method overload ‘ReflectionExtensions.GetCustomAttributes(Type, Type, bool)’ requires a receiver of type ‘Type’

Assets\AstarPathfindingProject\Core\Serialization\TinyJson.cs(64,18): error CS1929: ‘TypeInfo’ does not contain a definition for ‘GetFields’ and the best extension method overload ‘ReflectionExtensions.GetFields(Type, BindingFlags)’ requires a receiver of type ‘Type’

Jørn

Hi

Ok. Hm… It’s hard for me to debug this.
Would one of you be willing to join me in a Skype session to try to sort this out?

Sorry i wasn’t Clear enough. I actually get this errors while building to Universal 10 from Unity. So the errors occur in the build process.

Steps to reproduce.
In Build settings
Choose Platform - Windows Store
SDK - Universal 10
Target Device - Hololens ( Mobile will get the same errors)
Build and Run on - Local Machine
Debugging
Unity C# Projects - True

And then Build. This will generate the errors above in the Console in Unity.

i use Version 5.5.0p1

If you still are not able to reproduce i could show you.

Jørn

I’m getting the same issue with building to just plain Universal 10 on a normal Windows 10 desktop. (Non Hololens and Non Mobile) I really hope this is something that can get fixed. Thanks

Hi

For some reason Unity does not want to build a full build for me (still trying to figure out why), but I make a number of fixes (most of them untested however since I cannot do a full build). I have sent a PM to each of you with a download link to a preview version. This is based on the latest beta which also has a number of other changes (some of them breaking). The fixes should be pretty easy to back-port however so if the breaking changes (especially RVO) make it hard for you to test this I can upload a version based on the current release instead.

1 Like

This change should also make it unnecessary to use the ASTAR_NO_ZIP directive. On UWP it should now use System.IO.Compression.ZipArchive. Hopefully it is compatible with the zip spec that DotNetZip uses (I haven’t been able to test).

I tried it real quick and it did build in Unity but threw some warning errors in Unity. "Reference Rewriter found some errors while running with command --target=“Temp\StagingArea\Pathfinding.Ionic.Zip.Reduced.dll” --additionalreferences=“Temp\StagingArea” and a bunch of these “Reference rewriter: Error: method System.Void System.ComponentModel.DescriptionAttribute::.ctor(System.String) doesn’t exist in target framework. It is referenced from Pathfinding.Ionic.Zip.Reduced.dll at Pathfinding.Ionic.ComparisonOperator.
UnityEngine.Debug:LogError(Object)
PostProcessWinRT:RunReferenceRewriter() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:583)
PostProcessWinRT:Process() (at C:/buildslave/unity/build/PlatformDependent/WinRT/SharedSources/CSharp/PostProcessWinRT.cs:126)
UnityEditor.HostView:OnGUI()”

But the Visual Studio project doesn’t build at all. it has an error “The command Unity\Tools\AssemblyConverter.exe” -platform=uap -lock=" and a bunch more dlls exited with code 1.

I only imported the package and tried building. It built and ran fine for the normal Windows build but still getting hung up with the UWP. I could do a skype session with you sometime if you want to send me an email and we could probably figure out a time. Thanks for your help!

Hi

Hm, might be some meta file that wasn’t updated when you imported. That dll should be marked as excluded from all UWP builds. You can select it and mark it as such.

1 Like

That did the trick. Unchecked “Any Platform” on the Pathfinding.Ionic.Zip.Reduced. Thanks so much!

Edit:
Yep. That version exported and worked great as UWP and as Windows Standalone

I did not try the ASTAR_NO_ZIP. It was unchecked when i built everything last night. I’ve only been using it for about a week to see if it would fit my needs so I’m only building Grid Graphs dynamically right now but that all functioned perfectly.

So it works fine in a standalone player now?

Awesome :slight_smile: Were you using the ASTAR_NO_ZIP compiler directive?

I’m running into the same issue. Can you please PM the link with the fix?

me as well, it would be appreciated :wink:

Hi

I have just uploaded a new release (3.8.8) which contains these fixes. It is not the exact same build as was sent in a PM to some users (that was based on the beta branch).

1 Like

Ah you are creating graphs dynamically. Ok then the zip part of the code might still be untested. Hopefully it works.

FYI, there is some unfinished task code, that prevents compile in uwp.
in RecastGenerator.ScanAllTiles - I commented them out on my side.

@twlomega Huh, that code compiled just fine for me. What errors does it give you? And what build settings are you using exactly?