Author Topic: NGUI 2.6.2 Flash build errors  (Read 8991 times)

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
NGUI 2.6.2 Flash build errors
« on: June 16, 2013, 08:53:07 AM »
Hi,

I'm trying to make a simple testbuild for a flash game we are making. But when I try to compile my project i get the following error messages:
Quote
Usage of a type or method not supported by Unity Flash.
* Details:  Return type of unsupported type System.Reflection.PropertyInfo
* Source:   D:\Unity Projects\SWF Test\Assets\Plugins\NGUI\Internal\NGUITools.cs(?H815 at line : 0

 Usage of a type or method not supported by Unity Flash.
* Details:   Invokes an unsupported method System.Object System.Reflection.PropertyInfo::GetValue(System.Object,System.Object[]) on type System.Reflection.PropertyInfo
* Source:   D:\Unity Projects\SWF Test\Assets\Plugins\NGUI\Internal\NGUITools.cs(?H839 at line : 0

 Usage of a type or method not supported by Unity Flash.
* Details:   Invokes an unsupported method System.Void System.Reflection.PropertyInfo::SetValue(System.Object,System.Object,System.Object[]) on type System.Reflection.PropertyInfo
* Source:   D:\Unity Projects\SWF Test\Assets\Plugins\NGUI\Internal\NGUITools.cs(?H844 at line : 0

Error building Player: Exception: Validation step FlashDotNetAPIValidationRule Failed!

I checked the NGUITools.cs file but when i try to comment some of the stuff out which genereates the errors i only get more errors :(
« Last Edit: June 16, 2013, 02:59:37 PM by Tripwire »

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
Re: NGUI 2.6.2 Flash build errors
« Reply #1 on: June 16, 2013, 03:06:15 PM »
Fixed the first set of build errors by commenting out the stuff. But now it generates some more errors:
Quote
D:\Unity Projects\SWF Test\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIWidget.as(277): col: 43 Error: Access of possibly undefined property depth through a reference with static type global:UIWidget.

D:\Unity Projects\SWF Test\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIWidget.as(277): col: 54 Error: Access of possibly undefined property depth through a reference with static type global:UIWidget.

D:\Unity Projects\SWF Test\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIFont.as(454): col: 17 Error: Call to a possibly undefined method Object_Equals_Object_Object through a reference with static type Class.

Error building Player: Exception: java Failed:
Loading configuration file D:\Unity\Editor\Data\PlaybackEngines\flashsupport\BuildTools\flex\frameworks\flex-config.xml

D:\Unity Projects\SWF Test\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIWidget.as(277): col: 43 Error: Access of possibly undefined property depth through a reference with static type global:UIWidget.

               return Int32Operations.CompareTo($w2.depth, $w1.depth);
                                                    ^

D:\Unity Projects\SWF Test\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIWidget.as(277): col: 54 Error: Access of possibly undefined property depth through a reference with static type global:UIWidget.

               return Int32Operations.CompareTo($w2.depth, $w1.depth);
                                                               ^

D:\Unity Projects\SWF Test\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIFont.as(454): col: 17 Error: Call to a possibly undefined method Object_Equals_Object_Object through a reference with static type Class.

            if (!Object.Object_Equals_Object_Object(this.UIFont$mDynamicFontOffset$, $num)) {
                        ^


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 2.6.2 Flash build errors
« Reply #2 on: June 16, 2013, 10:07:38 PM »
Flash support is being dropped by Unity -- you know that, right?

You can fix that part by replacing all of it with:
  1. #if !UNITY_WEBPLAYER && !UNITY_FLASH && !UNITY_METRO
  2.         static PropertyInfo mSystemCopyBuffer = null;
  3.         static PropertyInfo GetSystemCopyBufferProperty ()
  4.         {
  5.                 if (mSystemCopyBuffer == null)
  6.                 {
  7.                         Type gui = typeof(GUIUtility);
  8.                         mSystemCopyBuffer = gui.GetProperty("systemCopyBuffer", BindingFlags.Static | BindingFlags.NonPublic);
  9.                 }
  10.                 return mSystemCopyBuffer;
  11.         }
  12.  
  13.         /// <summary>
  14.         /// Access to the clipboard via a hacky method of accessing Unity's internals. Won't work in the web player.
  15.         /// </summary>
  16.  
  17.         public static string clipboard
  18.         {
  19.                 get
  20.                 {
  21.                         PropertyInfo copyBuffer = GetSystemCopyBufferProperty();
  22.                         return (copyBuffer != null) ? (string)copyBuffer.GetValue(null, null) : null;
  23.                 }
  24.                 set
  25.                 {
  26.                         PropertyInfo copyBuffer = GetSystemCopyBufferProperty();
  27.                         if (copyBuffer != null) copyBuffer.SetValue(null, value, null);
  28.                 }
  29.         }
  30. #else
  31.         /// <summary>
  32.         /// Access to the clipboard is not supported on this platform.
  33.         /// </summary>
  34.  
  35.         public static string clipboard
  36.         {
  37.                 get { return null; }
  38.                 set { };
  39.         }
  40. #endif

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
Re: NGUI 2.6.2 Flash build errors
« Reply #3 on: June 17, 2013, 03:29:11 AM »
Flash support is being dropped by Unity -- you know that, right?

You can fix that part by replacing all of it with:
  1. #if !UNITY_WEBPLAYER && !UNITY_FLASH && !UNITY_METRO
  2.         static PropertyInfo mSystemCopyBuffer = null;
  3.         static PropertyInfo GetSystemCopyBufferProperty ()
  4.         {
  5.                 if (mSystemCopyBuffer == null)
  6.                 {
  7.                         Type gui = typeof(GUIUtility);
  8.                         mSystemCopyBuffer = gui.GetProperty("systemCopyBuffer", BindingFlags.Static | BindingFlags.NonPublic);
  9.                 }
  10.                 return mSystemCopyBuffer;
  11.         }
  12.  
  13.         /// <summary>
  14.         /// Access to the clipboard via a hacky method of accessing Unity's internals. Won't work in the web player.
  15.         /// </summary>
  16.  
  17.         public static string clipboard
  18.         {
  19.                 get
  20.                 {
  21.                         PropertyInfo copyBuffer = GetSystemCopyBufferProperty();
  22.                         return (copyBuffer != null) ? (string)copyBuffer.GetValue(null, null) : null;
  23.                 }
  24.                 set
  25.                 {
  26.                         PropertyInfo copyBuffer = GetSystemCopyBufferProperty();
  27.                         if (copyBuffer != null) copyBuffer.SetValue(null, value, null);
  28.                 }
  29.         }
  30. #else
  31.         /// <summary>
  32.         /// Access to the clipboard is not supported on this platform.
  33.         /// </summary>
  34.  
  35.         public static string clipboard
  36.         {
  37.                 get { return null; }
  38.                 set { };
  39.         }
  40. #endif

I know but since the bossman doesn't like to have users install a plugin to use Unity3D, Flash is the only option  :(.

So i changed the code like you stated but now i get these errors while building:

Quote
D:\Unity Projects\ReactionTest\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIWidget.as(277): col: 43 Error: Access of possibly undefined property depth through a reference with static type global:UIWidget.

D:\Unity Projects\ReactionTest\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIWidget.as(277): col: 54 Error: Access of possibly undefined property depth through a reference with static type global:UIWidget.

D:\Unity Projects\ReactionTest\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIFont.as(454): col: 17 Error: Call to a possibly undefined method Object_Equals_Object_Object through a reference with static type Class.

Error building Player: Exception: java Failed:
Loading configuration file D:\Unity\Editor\Data\PlaybackEngines\flashsupport\BuildTools\flex\frameworks\flex-config.xml

D:\Unity Projects\ReactionTest\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIWidget.as(277): col: 43 Error: Access of possibly undefined property depth through a reference with static type global:UIWidget.

               return Int32Operations.CompareTo($w2.depth, $w1.depth);
                                                    ^

D:\Unity Projects\ReactionTest\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIWidget.as(277): col: 54 Error: Access of possibly undefined property depth through a reference with static type global:UIWidget.

               return Int32Operations.CompareTo($w2.depth, $w1.depth);
                                                               ^

D:\Unity Projects\ReactionTest\Temp\StagingArea\Data\ConvertedDotNetCode\global\UIFont.as(454): col: 17 Error: Call to a possibly undefined method Object_Equals_Object_Object through a reference with static type Class.

            if (!Object.Object_Equals_Object_Object(this.UIFont$mDynamicFontOffset$, $num)) {
                        ^
« Last Edit: June 17, 2013, 03:47:53 AM by Tripwire »

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
Re: NGUI 2.6.2 Flash build errors
« Reply #4 on: June 17, 2013, 04:41:22 PM »
Tried checking out the UIWidget.cs script but couldn't find anything which looks like the errors the Flash build is generating.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 2.6.2 Flash build errors
« Reply #5 on: June 17, 2013, 09:36:52 PM »
I have no idea about that one as it doesn't point me in the right direction. UIWidget.depth is a property, not a variable... so how can it be undefined? That makes no sense to me.

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
Re: NGUI 2.6.2 Flash build errors
« Reply #6 on: June 19, 2013, 04:50:41 PM »
Hmm right, well i'll post it on the Unity3D forums. Maybe someone has the answer there.

EDIT:
I'm using NGUI 2.6.2 freshly downloaded from the asset store, is there a way to get an older version say NGUI 2.6.0 or 2.6.1 so i can test if it's a problem with the newest version of NGUI?
« Last Edit: June 19, 2013, 05:08:30 PM by Tripwire »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: NGUI 2.6.2 Flash build errors
« Reply #7 on: June 20, 2013, 07:24:34 AM »
2.6.3 fixes this. Sorry forgot to update the post. I will release it likely tomorrow.

Tripwire

  • Full Member
  • ***
  • Thank You
  • -Given: 9
  • -Receive: 0
  • Posts: 163
    • View Profile
Re: NGUI 2.6.2 Flash build errors
« Reply #8 on: June 21, 2013, 05:27:21 AM »
2.6.3 fixes this. Sorry forgot to update the post. I will release it likely tomorrow.

Very nice i'll wait for 2.6.3 then :)