Author Topic: UI Draw Call error when building assetbundles  (Read 6717 times)

Dust

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 7
    • View Profile
UI Draw Call error when building assetbundles
« on: December 10, 2013, 05:26:42 PM »
So at some point during the 3.0x upgrade cycle I started to get errors and recently I am now crashing out randomish when changing scenes.  I am trying to figure out what happened so figured I would start with this.

Whenever i run my script to build out some asset bundles from a scene I will get this error spamming the console once it has completed.

  1. MissingReferenceException: The object of type 'UIDrawCall' has been destroyed but you are still trying to access it.
  2. Your script should either check if it is null or you should not destroy the object.
  3. UnityEngine.Component.get_gameObject () (at C:/BuildAgent/work/ea95e74f6e5f192d/Runtime/ExportGenerated/Editor/UnityEngineComponent.cs:183)
  4. UIDrawCall.ReleaseAll () (at Assets/NGUI/Scripts/Internal/UIDrawCall.cs:726)
  5. UIPanel.OnDisable () (at Assets/NGUI/Scripts/UI/UIPanel.cs:696)
  6. UnityEditor.BuildPipeline:BuildStreamedSceneAssetBundle(String[], String, BuildTarget)
  7. ExportAssetBundles:ExportSceneToAssetBundle() (at Assets/Scripts/Editor/ExportAssetBundles.cs:64)

Any ideas? This is if I am in a scene using NGUI to do the build (which builds ios, then standalone, then android version of the assetbundle containing just a scene) I get the errors.  If i am in a blank scene I get no errors.

Unity 4.2.2 (pro)
nGUI latest (3.07f1?)  but this started happening I want to say in atleast 3.06 something


ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Draw Call error when building assetbundles
« Reply #1 on: December 10, 2013, 09:33:11 PM »
NGUI doesn't work correctly from asset bundles. It never had, and I'm surprised you didn't run into such issues before. I'm guessing its related to a global list of draw calls. I plan on changing it back to where each panel owning their own draw calls in the near future, so it should address this issue as well.

However as I said... asset bundles + NGUI is not a good combination.

Dust

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: UI Draw Call error when building assetbundles
« Reply #2 on: December 11, 2013, 01:47:52 PM »
NGUI doesn't work correctly from asset bundles. It never had, and I'm surprised you didn't run into such issues before. I'm guessing its related to a global list of draw calls. I plan on changing it back to where each panel owning their own draw calls in the near future, so it should address this issue as well.

However as I said... asset bundles + NGUI is not a good combination.

Super weird as this only happens lately when building the bundles using an open scene that has ngui in it, not actually testing in editor or on device.  Ive been using nGUI in assetbundles for a few months in a production game without any actual issues.

I think it might be something else causing the issue, possibly unity related, but was hoping to track this one down in the meantime.  I get some weird "Fatal Error! CheckDisalowAllocation. Allocating memory when it is not allowed to allocate memory." error at random if I open up a scene with ngui,  make some changes like rename some text in a label, and when i go to load another scene after saving the current scene it crashes with that error.

EDIT: Oh btw not really looking for an answer if there is none or normal use for unity will cause this issue now.  I havent tried wiping out my local cache of the project and rebuilding or even trying on another machine or with any of the 4.3 builds on unity yet =)

bdominguez

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 1
  • Posts: 38
    • View Profile
Re: UI Draw Call error when building assetbundles
« Reply #3 on: December 24, 2013, 03:12:15 AM »
I get some weird "Fatal Error! CheckDisalowAllocation. Allocating memory when it is not allowed to allocate memory." error at random if I open up a scene with ngui,  make some changes like rename some text in a label, and when i go to load another scene after saving the current scene it crashes with that error.

I have the same problem (in my case running Unity 4.2.2). And also I see this in console sometimes:

"Destroying object multiple times. Don't use DestroyImmediate on the same object in OnDisable or OnDestroy."

It has to be NGUI because I don't use anywhere DestroyImmediate in my project and I don't have any other assets.

I know it's something between 3.0.3 and 3.0.7... Please Aren take a look because it crashes Unity!!

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UI Draw Call error when building assetbundles
« Reply #4 on: December 24, 2013, 01:16:32 PM »
Take a look at what? I'd need repro steps to follow.

Dust

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 7
    • View Profile
Re: UI Draw Call error when building assetbundles
« Reply #5 on: December 25, 2013, 02:44:19 AM »
I have the same problem (in my case running Unity 4.2.2). And also I see this in console sometimes:

"Destroying object multiple times. Don't use DestroyImmediate on the same object in OnDisable or OnDestroy."

It has to be NGUI because I don't use anywhere DestroyImmediate in my project and I don't have any other assets.

I know it's something between 3.0.3 and 3.0.7... Please Aren take a look because it crashes Unity!!

I narrowed this down to having Panels without a rigidbody attached. When I went back into the scenes I was having issues with, made sure all my panels had the correct rigidbodies attached, saved, then reloaded unity (since loading the scene up without rigidbodies on the panels seemed to cause the problem in the first place) I no longer had the disalow crash in Unity.

I figured this out when exporting from an older version of unity a package with something I wanted in another project and even in an empty scene it was causing the crash but if i created it all from scratch in the empty scene no issue.  The older project i was exporting from was from a version of nGUI that did not attach the rigidbodies to the same GO as the panel.

I hope this helps bdominguez