Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: unitydude on April 17, 2014, 07:31:23 PM

Title: 3.5.7 build fails for Windows 8/8.1 in in Unity 4.3
Post by: unitydude on April 17, 2014, 07:31:23 PM
Hi,

I am trying to build Example 0 (or anything else) targeting Windows Store Apps, the build fails with the following messages


--------------------
Assets\NGUI\Scripts\Internal\PropertyReference.cs(302,12): error CS1061: 'System.Type' does not contain a definition for 'IsClass' and no extension method 'IsClass' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

Assets\NGUI\Scripts\Internal\PropertyReference.cs(344,10): error CS1061: 'System.Type' does not contain a definition for 'IsAssignableFrom' and no extension method 'IsAssignableFrom' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

Assets\NGUI\Scripts\Internal\PropertyReference.cs(403,18): error CS1061: 'System.Type' does not contain a definition for 'GetField' and no extension method 'GetField' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

Assets\NGUI\Scripts\Internal\PropertyReference.cs(404,21): error CS1061: 'System.Type' does not contain a definition for 'GetProperty' and no extension method 'GetProperty' accepting a first argument of type 'System.Type' could be found (are you missing a using directive or an assembly reference?)

Error building Player because scripts had compiler errors
----------------------------------------

Notes:
-I have unity 4.3.4.f.1 on a Win 8.1 x64 machine.
-I was able to successfully build Example 0 for the windows phone 8
-I am able to build other apps normally targeting windows store apps
-I tried targeting 8.0 and 8.1 (same errors)
-tried a simple scene with one sprite and got the exact errors

Can you please advise

Thanks
Title: Re: 3.5.7 build fails for Windows 8/8.1 in in Unity 4.3
Post by: ArenMook on April 18, 2014, 04:08:04 PM
WP8/WSA doesn't support reflection properly, so none of that will work. Change the #ifdef at the top of the file to:
  1. #if UNITY_EDITOR || (!UNITY_FLASH && !NETFX_CORE && !UNITY_WP8)
  2. #define REFLECTION_SUPPORT
  3. #endif
Title: Re: 3.5.7 build fails for Windows 8/8.1 in in Unity 4.3
Post by: unitydude on April 18, 2014, 06:03:22 PM
WP8/WSA doesn't support reflection properly, so none of that will work. Change the #ifdef at the top of the file to:
  1. #if UNITY_EDITOR || (!UNITY_FLASH && !NETFX_CORE && !UNITY_WP8)
  2. #define REFLECTION_SUPPORT
  3. #endif

Thank you for the answer, FYI  for you to add in later versions  I had to put #if REFLECTION_SUPPORT

around

[DebuggerHidden]
[DebuggerStepThrough]

And the Reset method

Cheers

Title: Re: 3.5.7 build fails for Windows 8/8.1 in in Unity 4.3
Post by: LoneCoder on April 27, 2014, 10:40:14 AM
This problem is still happening in the current 3.5.8 build from the asset store.
Title: Re: 3.5.7 build fails for Windows 8/8.1 in in Unity 4.3
Post by: ArenMook on April 27, 2014, 11:53:04 PM
http://www.tasharen.com/forum/index.php?topic=9187.msg43308#msg43308
Title: Re: 3.5.7 build fails for Windows 8/8.1 in in Unity 4.3
Post by: LoneCoder on May 14, 2014, 01:08:59 PM
It's happening again in 3.5.9. This time at the new ByteReader since File is not available in Metro.

Here is how I fixed it:

   static public ByteReader Open (string path)
   {
        throw new System.NotImplementedException();
        //FileStream fs = File.OpenRead(path);

        //if (fs != null)
        //{
        //    fs.Seek(0, SeekOrigin.End);
        //    byte[] buffer = new byte[fs.Position];
        //    fs.Seek(0, SeekOrigin.Begin);
        //    fs.Read(buffer, 0, buffer.Length);
        //    fs.Close();
        //    return new ByteReader(buffer);
        //}
        //return null;
   }

Perhaps you could setup a batch file to try out all the builds using the unity command line: https://docs.unity3d.com/Documentation/Manual/CommandLineArguments.html

Then you could find these kinds of build errors easily before releasing.