jacobdufault / fullserializer

A robust JSON serialization framework that just works with support for all major Unity export platforms.
MIT License
1.11k stars 169 forks source link

Windows Store - Phone 8.1: Build issues #115

Open Tregan opened 7 years ago

Tregan commented 7 years ago

I imported the source in Unity to Assets/Plugins/FullSerializer/Source, and in Player Settings Compilation Overrides is set to "Use Net Core Partially", but when building I get the error:

Assets/Plugins/FullSerializer/Source/Internal/fsPortableReflection.cs(358,23): error CS0246: The type or namespace name `TypeInfo' could not be found. Are you missing a using directive or an assembly reference?

UWP 8.1 has TypeInfo right, so I don't really see what's going on here. Tried it with both the source of latest release (https://github.com/jacobdufault/fullserializer/releases/tag/1.0) and a download of the master branch.

-Edit- Moving the source out of the Plugins folder (Because of the "Use Net Core Partially", derp... -.-), so to Assets/FullSerializer/Source gives different errors:

Assets\FullSerializer\Source\Converters\Unity\UnityEvent_Converter.cs(26,20): error CS1502: The best overloaded method match for 'System.Reflection.TypeInfo.IsAssignableFrom(System.Reflection.TypeInfo)' has some invalid arguments

Assets\FullSerializer\Source\Converters\Unity\UnityEvent_Converter.cs(26,66): error CS1503: Argument 1: cannot convert from 'System.Type' to 'System.Reflection.TypeInfo'

Assets\FullSerializer\Source\Converters\Unity\UnityEvent_Converter.cs(26,80): error CS1061: 'System.Type' does not contain a definition for 'IsGenericType' and no extension method 'IsGenericType' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(17,54): error CS1061: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?)

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(112,32): error CS1061: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'Length' and no extension method 'Length' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?)

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(113,44): error CS0021: Cannot apply indexing with [] to an expression of type 'System.Collections.Generic.IEnumerable'

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(219,60): error CS1061: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?)

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(303,55): error CS1061: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?)

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(311,58): error CS1061: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?)

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(319,54): error CS1061: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?)

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(327,55): error CS1061: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?)

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(397,61): error CS1061: 'System.Collections.Generic.IEnumerable' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Collections.Generic.IEnumerable' could be found (are you missing a using directive or an assembly reference?)

Assets\FullSerializer\Source\Internal\fsPortableReflection.cs(401,60): error CS1061: 'System.Array' does not contain a definition for 'ToArray' and no extension method 'ToArray' accepting a first argument of type 'System.Array' could be found (are you missing a using directive or an assembly reference?)

jacobdufault commented 7 years ago

This should be relatively simple to fix (some type calls are most likely missing .Resolve() postfix). I'll try to upload a patch within the next few days.

tng2903 commented 7 years ago

Hello,

Is there any update related to this issue?

eusebiu commented 7 years ago

I added the .Resolve() where it was needed but there is an extension method that has the type TypeInfo. public static TypeInfo Resolve(this Type type) { return type.GetTypeInfo(); } Somehow the Unity compiler does not recognise the type for WSA/UWP 10.

In the Player settings I can see that the API Compatibility Level set to "WSA subset" but I cannot change it.

How can I make Unity aware of this type?

BrknRobot commented 7 years ago

These errors should be fixed with #136. Can you test against the latest code in master?

Eliphas343 commented 7 years ago

I'm currently trying to build my application for Windows Universal App and I'm getting that the namespace 'TypeInfo' could not be found on the fsPortableReflection.cs script.

image

It works good with IL2CPP but I would like to use them with the .NET backend.