Skip to content

Null Reference when exporting the Build Size Data to CSV #222

@sp-matei-giurgiu

Description

@sp-matei-giurgiu

Describe the bug
When trying to export the build size data to CSV there is a null reference error. The file it's created but it's empty.

NullReferenceException: Object reference not set to an instance of an object
System.Linq.Enumerable+SelectManySingleSelectorIterator`2[TSource,TResult].MoveNext () (at <f97e358e7a5e4bf5ba1b3e551d919146>:0)
System.Linq.Enumerable.TryGetFirst[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate, System.Boolean& found) (at <f97e358e7a5e4bf5ba1b3e551d919146>:0)
System.Linq.Enumerable.FirstOrDefault[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] predicate) (at <f97e358e7a5e4bf5ba1b3e551d919146>:0)
Unity.ProjectAuditor.Editor.Report.GetLayout (Unity.ProjectAuditor.Editor.IssueCategory category) (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/API/Report.cs:250)
Unity.ProjectAuditor.Editor.Core.Exporter.Export (System.String path, Unity.ProjectAuditor.Editor.IssueCategory category, System.Func`2[T,TResult] predicate) (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/Core/Exporter.cs:24)
Unity.ProjectAuditor.Editor.UI.Framework.AnalysisView.Export (System.Func`2[T,TResult] predicate) (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/UI/Framework/AnalysisView.cs:692)
Unity.ProjectAuditor.Editor.UI.Framework.AnalysisView.DrawDataOptions () (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/UI/Framework/AnalysisView.cs:587)
Unity.ProjectAuditor.Editor.UI.Framework.AnalysisView.DrawToolbar () (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/UI/Framework/AnalysisView.cs:509)
Unity.ProjectAuditor.Editor.UI.Framework.AnalysisView.DrawTable () (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/UI/Framework/AnalysisView.cs:456)
Unity.ProjectAuditor.Editor.UI.Framework.AnalysisView.DrawContent (System.Boolean showDetails) (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/UI/Framework/AnalysisView.cs:391)
Unity.ProjectAuditor.Editor.UI.ProjectAuditorWindow.DrawReport () (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/UI/ProjectAuditorWindow.cs:1626)
Unity.ProjectAuditor.Editor.UI.ProjectAuditorWindow.DrawPanels () (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/UI/ProjectAuditorWindow.cs:1466)
Unity.ProjectAuditor.Editor.UI.ProjectAuditorWindow.OnGUI () (at Library/PackageCache/com.unity.project-auditor@d9a7891015/Editor/UI/ProjectAuditorWindow.cs:485)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
UnityEditor.DockArea.DrawView (UnityEngine.Rect dockAreaRect) (at <6e08e61cfda04255b3972ba7f0515fae>:0)
UnityEditor.DockArea.OldOnGUI () (at <6e08e61cfda04255b3972ba7f0515fae>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <4afa7aba4e754829b9f32c254e65e7c8>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <2880c19c3b344d8cb20d5ad03e3efbe5>:0)

To Reproduce
Steps to reproduce the behavior:

  1. Open ProjectAuditor
  2. Analyze the Build Report from an Android build.
  3. Go to Build > Build Size > Click Export > All
    image

Expected behavior
A CSV file populated with build data is created at the selected location.

Information (please complete the following information):

  • OS: Windows 11
  • Unity version: 2021.3.20f1
  • Project Auditor version: 0.11.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions