Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Jesse on February 25, 2015, 08:27:11 PM

Title: Editor is works great, build throws error (wrapper)
Post by: Jesse on February 25, 2015, 08:27:11 PM
Hello,

I am using NGUI 3.8.0 and I also used 3.7.1. I am using Unity 4.6.3, I also used 4.6.2p1 and 4.6.1p1. All of these on all versions gave this error only in the build.

(Filename: C:/buildslave/unity/build/artifacts/StandalonePlayerGenerated/UnityEngineComponent.cs Line: 21)

NullReferenceException
  at (wrapper managed-to-native) UnityEngine.Component:InternalGetTransform ()

  at UnityEngine.Component.get_transform () [0x00000] in C:\buildslave\unity\build\artifacts\StandalonePlayerGenerated\UnityEngineComponent.cs:21

  at UIDrawCall.get_cachedTransform () [0x00011] in C:\Users\...\Assets\Plugins\NGUI\Internal\UIDrawCall.cs:175

  at UIPanel.UpdateDrawCalls () [0x00199] in C:\Users\...\Assets\Plugins\NGUI\UI\UIPanel.cs:1473

  at UIPanel.LateUpdate () [0x00080] in C:\Users\...\Assets\Plugins\NGUI\UI\UIPanel.cs:1207

NGUI works great in the editor. Only on build does it throw this error. When I turn off all NGUI items the error goes away.

Do you have any idea what might be causing it? The programmer who also worked on it said it is most likely to do with NGUI. The inventory system we have works perfectly except when built. Should I send you the project? Or can you determine it from this error?

Thank you!

Sincerely,
Jesse
Title: Re: Editor is works great, build throws error (wrapper)
Post by: ArenMook on February 27, 2015, 04:44:22 AM
If you look at that section of the code, all it does is accesses Component.transform -- and the exception occurs inside Unity's code (InternalGetTransform). Did you check to see if an earlier version of Unity gives you this problem? Do you have stripping enabled?
Title: Re: Editor is works great, build throws error (wrapper)
Post by: Jesse on February 27, 2015, 05:13:52 AM
Hello Aren,

Thank you for the quick reply!

I did not check earlier versions. I only checked these 4.6.3p1, 4.6.3, 4.6.2p1 and 4.6.1p1. I will check earlier versions later today and post an update.

I apologize, I don't understand what "stripping enabled" means. I looked it up, it looks like it has to do with iOS and Andriod. We are building the inventory for PC (Win, Mac, and Linux)

This problem occurs on both Mac OSX and Windows 7. I haven't tested other OS's.
Title: Re: Editor is works great, build throws error (wrapper)
Post by: Jesse on February 27, 2015, 01:36:36 PM
Hello Aren,

I tested the inventory in both 4.3.4 and 4.5.5. There were compatibility errors with 4.3.4 so I was unable to test it. In 4.5.5 the error still exists giving this error:

(Filename: C Line: 0)

NullReferenceException
  at (wrapper managed-to-native) UnityEngine.Component:InternalGetTransform ()

  at UnityEngine.Component.get_transform () [0x00000] in C:\BuildAgent\work\d63dfc6385190b60\artifacts\StandalonePlayerGenerated\UnityEngineComponent.cs:20

  at UIDrawCall.get_cachedTransform () [0x00011] in C:\Users\...\Assets\NGUI\Scripts\Internal\UIDrawCall.cs:175

  at UIPanel.UpdateDrawCalls () [0x00199] in C:\Users\...\Assets\NGUI\Scripts\UI\UIPanel.cs:1473

  at UIPanel.LateUpdate () [0x00080] in C:\Users\...\Assets\NGUI\Scripts\UI\UIPanel.cs:1207

Do you think I should submit a repo to Unity?
Title: Re: Editor is works great, build throws error (wrapper)
Post by: ArenMook on March 01, 2015, 04:45:33 PM
Unity won't be able to help you here. What are you doing in your UI that's causing this to happen? Are you destroying a part of it somewhere? Is a part of your UI marked as DontDestroyOnLoad and the other part isn't, and you then switch scenes? I need more details here. If it happens in Unity 4.5 then it's something wrong with what you're doing.