Errors when compiling to Windows Store app

0 votes
asked Dec 18, 2016 in Issue by quadchess (200 points)

Got my game nicely set up with the UI, and my next step was building it into a Microsoft Hololens app, and ran into some issues keeping me from doing it. It's much more strict with the new .NET Core framework. Here are the Unity compiler errors we're getting when building as a Windows Store Universal 10 app (UWP build type XAML) that I hope you can help with.

Assets\MaterialUI\Utils\LitJson\JsonReader.cs(405,24): error CS1061: 'TextReader' does not contain a definition for 'Close' and no extension method 'Close' accepting a first argument of type 'TextReader' could be found (are you missing a using directive or an assembly reference?)
Assets\MaterialUI\Utils\LitJson\JsonMapper.cs(173,22): error CS1061: 'Type' does not contain a definition for 'GetInterface' and no extension method 'GetInterface' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)
Assets\MaterialUI\Utils\LitJson\JsonMapper.cs(205,22): error CS1061: 'Type' does not contain a definition for 'GetInterface' and no extension method 'GetInterface' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)
Assets\MaterialUI\Utils\LitJson\JsonMapper.cs(317,31): error CS1061: 'Type' does not contain a definition for 'IsClass' and no extension method 'IsClass' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)
Assets\MaterialUI\Utils\LitJson\JsonMapper.cs(372,32): error CS1061: 'Type' does not contain a definition for 'IsEnum' and no extension method 'IsEnum' accepting a first argument of type 'Type' could be found (are you missing a using directive or an assembly reference?)

I've tried fixing the LitJson utility, going through the errors and upgrading the API to the new .NET, but still no luck.  I did find a fork of LitJson that is supposed to make it .NET Core Compatible at https://github.com/WCOMAB/litjson/ but it got a little tricky.  I assume other people have ran into this issue, and it shouldn't be too complicated to fix, just needed some help.  If we get this working though, I'd recommend it being part of the next update for MaterialUnity, as long as it's backwards compatible.  Thanks, if you want to check out what I have developed so far, I put up a limited beta you can apply for at http://QuadChess.com and see why this game has to be Hololens compatible... Will be interesting to see how the UI looks as an AR overlay..

~Alan

1 Answer

0 votes
answered Dec 19, 2016 by admin (31,720 points)
selected Dec 20, 2016 by admin
 
Best answer
Hello Alan!

Thanks for contacting us.
I think I have a super quick thing for you to do that will just work :)

We're currently relying on LitJson ONLY for people using 5.2 (after that, we use the build in Json reader from unity). And the code that uses LitJson is wrapped between #if UNITY_5_2 code. So if you delete the entire LitJson folder, everything will still work, and as LitJson is gone, you won't have the errors you have :D

And from what I can see, it seems we're releasing MaterialUI starting 5.3 for now... So we could remove that for the next update as well for everyone.

So problem solved :)
Have a great day!

~ Yohan
commented Dec 19, 2016 by quadchess (200 points)
Awesome, another simple fix did the trick.  Expected more errors after deleting /utils/LitJson but that's all it took.. Getting past that compiler block, now on to the rest of the errors I'm getting from other assets when porting to the new .NET, but at least there's one less to worry about, and I'm a step closer to seeing the Hololens build working.  Thanks for the help.
commented Dec 20, 2016 by admin (31,720 points)
Perfect!
Glad I could help :)

When you project is ready for prime time, we'd love to take a look at it!
Send us an email with a link to a preview or something when you can :)

~ Yohan
Welcome to MaterialUI support! Ask us anything :)
...