title: Unity 4.6p1 UI Crash in any Build
body: <p>I replaced my GUI I had in (4.5) to the new UI system in 4.6. I'm using 4.6p1 unity. The game runs in the Unity Editor fine, but once it has been built it crashes on loadup. I've removed all UI elements and it builds and runs, but then my game has no UI.</p>
  
  <p>In Unity, the console shows two errors on build:</p>
  
  <pre><code>    An asset is marked with HideFlags.DontSave but is included in the build:
  Asset: 'Library/unity default resources'
  (You are probably referencing internal Unity data in your build.)
  UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
  </code></pre>
  
  <p>and </p>
  
  <pre><code>    Building - Failed to write file: Temp/StagingArea/Data/Resources/unity_builtin_extra
  UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
  </code></pre>
  
  <p>When I get a crash log when I run the game, here is the stack trace:</p>
  
  <pre><code>(0x000000013F8DEC91) c:\buildagent\work\d63dfc6385190b60\runtime\shaders\material.cpp (280 + 0x0): Unity::Material::CreateMaterial + 0x41
  (0x000000000478627C) (Mono JIT code): (filename not available):  UnityEngine.UI.Text:get_defaultMaterial () + 0x3c (0000000004786240 0000000004786295) [0000000003CD4D48 - Unity Root Domain] + 0x0
  (0x0000000004786201) (Mono JIT code): (filename not available):  UnityEngine.UI.Graphic:get_material () + 0x41 (00000000047861C0 0000000004786213) [0000000003CD4D48 - Unity Root Domain] + 0x0
  (0x0000000004785D8C) (Mono JIT code): (filename not available):  UnityEngine.UI.MaskableGraphic:get_material () + 0xec (0000000004785CA0 0000000004785D98) [0000000003CD4D48 - Unity Root Domain] + 0x0
  (0x0000000004785B51) (Mono JIT code): (filename not available):  UnityEngine.UI.Graphic:get_materialForRendering () + 0x61 (0000000004785AF0 0000000004785C72) [0000000003CD4D48 - Unity Root Domain] + 0x0
  (0x0000000004785A77) (Mono JIT code): (filename not available):  UnityEngine.UI.Graphic:UpdateMaterial () + 0x57 (0000000004785A20 0000000004785AC2) [0000000003CD4D48 - Unity Root Domain] + 0x0
  (0x0000000004781DA8) (Mono JIT code): (filename not available):  UnityEngine.UI.Graphic:Rebuild (UnityEngine.UI.CanvasUpdate) + 0x58 (0000000004781D50 0000000004781DB6) [0000000003CD4D48 - Unity Root Domain] + 0x0
  (0x000000000478171D) (Mono JIT code): (filename not available):  UnityEngine.UI.CanvasUpdateRegistry:PerformUpdate () + 0x46d (00000000047812B0 00000000047818B2) [0000000003CD4D48 - Unity Root Domain] + 0x0
  (0x0000000004781276) (Mono JIT code): (filename not available):  UnityEngine.Canvas:SendWillRenderCanvases () + 0x26 (0000000004781250 000000000478127C) [0000000003CD4D48 - Unity Root Domain] + 0x0
  (0x0000000004730543) (Mono JIT code): (filename not available):  (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) + 0x63 (00000000047304E0 00000000047305B2) [0000000003CD4D48 - Unity Root Domain] + 0x0
  (0x000007FEE01D3AF2) (mono): (filename not available): mono_set_defaults + 0x2b9e
  (0x0000000003DDB0B8) ((module-name not available)): (filename not available): (function-name not available) + 0x0
  (0x00000000FFFFFFFF) ((module-name not available)): (filename not available): (function-name not available) + 0x0
  (0x0000000003CD4D48) ((module-name not available)): (filename not available): (function-name not available) + 0x0
  </code></pre>
  
  <p>So I know its the new UI causing the crash, but I have no clue how to fix.</p>
  
  <p>I am <code>using UnityEngine.UI;</code> in certain scripts to access UI text and change it. IE <code>scoreText.text = "Score: " + score;</code></p>
  
  <p>I disabled all code in scripts and that access <code>UnityEngine.UI;</code> but that did not work either. Any ideas on how to fix this?</p>