Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug 0.10.0 cant pull from google sheets anymore

Discussion in 'Localization Tools' started by sniffle63, Jan 29, 2021.

  1. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    365
    I upgrade to 0.10.0 and now I get this null reference everytime I try to pull a table

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEditor.Localization.Plugins.Google.GoogleSheets.MergePull (System.Collections.Generic.List`1[T] columns, UnityEditor.Localization.StringTableCollection collection, System.Collections.Generic.IList`1[T] columnMapping, System.Boolean removeMissingEntries, UnityEditor.Localization.Reporting.ITaskReporter reporter) (at Library/PackageCache/com.unity.localization@0.10.0-preview/Editor/Plugins/Google/GoogleSheets.cs:593)
    3. UnityEditor.Localization.Plugins.Google.GoogleSheets.PullIntoStringTableCollection (System.Int32 sheetId, UnityEditor.Localization.StringTableCollection collection, System.Collections.Generic.IList`1[T] columnMapping, System.Boolean removeMissingEntries, UnityEditor.Localization.Reporting.ITaskReporter reporter, System.Boolean createUndo) (at Library/PackageCache/com.unity.localization@0.10.0-preview/Editor/Plugins/Google/GoogleSheets.cs:478)
    4. UnityEditor.Localization.Plugins.Google.GoogleSheetsExtensionPropertyDrawer.DrawSyncControls (UnityEditor.Localization.Plugins.Google.GoogleSheetsExtensionPropertyDrawerData data, UnityEditor.SerializedProperty property, UnityEngine.Rect& position) (at Library/PackageCache/com.unity.localization@0.10.0-preview/Editor/Plugins/Google/GoogleSheetsExtensionPropertyDrawer.cs:334)
    5. UnityEditor.Localization.Plugins.Google.GoogleSheetsExtensionPropertyDrawer.OnGUI (UnityEditor.Localization.Plugins.Google.GoogleSheetsExtensionPropertyDrawerData data, UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/com.unity.localization@0.10.0-preview/Editor/Plugins/Google/GoogleSheetsExtensionPropertyDrawer.cs:197)
    6. UnityEditor.Localization.UI.PropertyDrawerExtended`1[TData].OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/com.unity.localization@0.10.0-preview/Editor/UI/Utility/PropertyDrawerExtended.cs:33)
    7. UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
    8. UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
    9. UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
    10. UnityEditor.EditorGUI.PropertyFieldInternal (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
    11. UnityEditor.EditorGUI.PropertyField (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
    12. UnityEditor.Localization.UI.ReorderableListExtended.DrawElement (UnityEngine.Rect rect, System.Int32 idx, System.Boolean isActive, System.Boolean isFocused) (at Library/PackageCache/com.unity.localization@0.10.0-preview/Editor/UI/Utility/ReorderableListExtended.cs:81)
    13. UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect) (at <e6e2fa0a47414cd2ac33237924761b45>:0)
    14. UnityEditorInternal.ReorderableList.DoLayoutList () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
    15. UnityEditor.Localization.UI.LocalizationTableCollectionEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.localization@0.10.0-preview/Editor/UI/Tables/LocalizationTableCollectionEditor.cs:200)
    16. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <e6e2fa0a47414cd2ac33237924761b45>:0)
    17. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
    18.  
    upload_2021-1-29_16-47-39.png

    I do have data in the columns, was working fine before I updated unfortunately!
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Can you see what is null?
     
  3. Metosian

    Metosian

    Joined:
    May 21, 2018
    Posts:
    14
    I experienced this bug too and rolled back to 0.9 to resolve it, colRowData was empty so colRowData[row] failed.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Could you file a bug report please
     
  5. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Same issue, do I need to file a bug report?
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Yes please. It will help if I have a reproduction of the bug so I can be sure its fixed.
     
  7. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Unfortunately, can share neither source code nor google doc so I doubt it will be useful for you, but if you have a preview version or something equivalent I can test.
     
  8. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    We don't need a doc. Just instructions on creating a doc that will reproduce the error. Is it caused by empty cells?
     
  9. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Added log into scripts


    Debug.LogError($"{colRowData[row] == null}"); => false
    Debug.LogError($"{colRowData[row]?.Values == null}"); => true

    So yes, it happens on the first empty cell. We have a locale that does not include all values, it should go to the fallback
     
  10. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    ah. Ok we expected Count to be 0 but its null instead :(
    Ok thats simple to fix. You can just change above line to this for now

    Code (csharp):
    1. if (colRowData.Count > row && colRowData[row]?.Values?.Count > valueIndex)
     
    Annmic and paradizIsCool like this.
  11. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    I get another error on cloud build, both ios and android builds after upgrading to 0.10.0 and dependencies


    FileNotFoundException: Library/com.unity.addressables/aa/...

    Testing builds on my laptop, android seems to work as espected, but not for ios, it's like I haven't built addressable... I need more investigation to give you more informations and I will send a bug report if needed.

    No Locale could be selected:
    No Locales were available. Did you build the Addressables?


    (Bundles are there in both platforms on my local build, in Library folder and in built project - Data/Raw in xcode project)
     
  12. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Did you tick the Build Addressables option in the cloud build settings?
     
  13. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Yes, the build was ok on the previous commit.
     
  14. paradizIsCool

    paradizIsCool

    Joined:
    Jul 10, 2014
    Posts:
    178
    Found, it fails with Addressable 1.16.16 (updated from 1.16.15 to 1.16.16)
     
  15. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Could you file a bug report please, sounds like it needs to go to the Addressables team.
     
    Last edited: Feb 3, 2021
    paradizIsCool likes this.
  16. Metosian

    Metosian

    Joined:
    May 21, 2018
    Posts:
    14
    Tried that to no success, looking deeper the problem is columns[col].rowdata was null above that as well. Will look into filing a bug
     
    karl_jones likes this.
  17. Metosian

    Metosian

    Joined:
    May 21, 2018
    Posts:
    14
    Bug has been reported, Case 1311922

    I don't think you can repro it immediately as I'd need to add an email to the OAuth for them, but perhaps you can use your own google sheets in that setting to get the same errors before that's necessary.
     
    karl_jones likes this.
  18. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Could you provide a copy of a sheet as csv/xls so that we can put it into a google sheet and get the same results?
     
  19. Metosian

    Metosian

    Joined:
    May 21, 2018
    Posts:
    14
    PM sent with a link to an xlsx
     
    karl_jones likes this.
  20. Metosian

    Metosian

    Joined:
    May 21, 2018
    Posts:
    14
    A team member had success with changing that line to the line below, performing a null check on colRowData first, and now can pull from google sheets but can't push - likely because we're only changing the MergePull method and not any of the push ones, but its enough to unblock the workflow and just work out of the sheet online.

    Code (CSharp):
    1. if (colRowData != null && colRowData.Count > row && colRowData[row]?.Values?.Count > valueIndex)
     
  21. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Thats also the fix we made. What problems do you have pushing, im not aware of any push bugs?
     
    Brogan89 likes this.
  22. ms502040

    ms502040

    Joined:
    Jan 9, 2019
    Posts:
    18
    same bug in 0.11.1 version - when column contains blank (untranslated row) between translated we got this error:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Localization.Plugins.Google.GoogleSheets.MergePull (System.Collections.Generic.List`1[T] columns, UnityEditor.Localization.StringTableCollection collection, System.Collections.Generic.IList`1[T] columnMapping, System.Boolean skipFirstRow, System.Boolean removeMissingEntries, UnityEditor.Localization.Reporting.ITaskReporter reporter) (at Library/PackageCache/com.unity.localization@0.11.1-preview/Editor/Plugins/Google/GoogleSheets.cs:593)
    UnityEditor.Localization.Plugins.Google.GoogleSheets.PullIntoStringTableCollection (System.Int32 sheetId, UnityEditor.Localization.StringTableCollection collection, System.Collections.Generic.IList`1[T] columnMapping, System.Boolean removeMissingEntries, UnityEditor.Localization.Reporting.ITaskReporter reporter, System.Boolean createUndo) (at Library/PackageCache/com.unity.localization@0.11.1-preview/Editor/Plugins/Google/GoogleSheets.cs:478)
    UnityEditor.Localization.Plugins.Google.GoogleSheetsExtensionPropertyDrawer.DrawSyncControls (UnityEditor.Localization.Plugins.Google.GoogleSheetsExtensionPropertyDrawerData data, UnityEditor.SerializedProperty property, UnityEngine.Rect& position) (at Library/PackageCache/com.unity.localization@0.11.1-preview/Editor/Plugins/Google/GoogleSheetsExtensionPropertyDrawer.cs:334)
    UnityEditor.Localization.Plugins.Google.GoogleSheetsExtensionPropertyDrawer.OnGUI (UnityEditor.Localization.Plugins.Google.GoogleSheetsExtensionPropertyDrawerData data, UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/com.unity.localization@0.11.1-preview/Editor/Plugins/Google/GoogleSheetsExtensionPropertyDrawer.cs:197)
    UnityEditor.Localization.UI.PropertyDrawerExtended`1[TData].OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at Library/PackageCache/com.unity.localization@0.11.1-preview/Editor/UI/Utility/PropertyDrawerExtended.cs:33)
    UnityEditor.PropertyDrawer.OnGUISafe (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label) (at <1798d6bccd2b44b2854be2fbcc2463b3>:0)
    UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren, UnityEngine.Rect visibleArea) (at <1798d6bccd2b44b2854be2fbcc2463b3>:0)
    UnityEditor.PropertyHandler.OnGUI (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <1798d6bccd2b44b2854be2fbcc2463b3>:0)
    UnityEditor.EditorGUI.PropertyFieldInternal (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <1798d6bccd2b44b2854be2fbcc2463b3>:0)
    UnityEditor.EditorGUI.PropertyField (UnityEngine.Rect position, UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, System.Boolean includeChildren) (at <1798d6bccd2b44b2854be2fbcc2463b3>:0)
    UnityEditor.Localization.UI.ReorderableListExtended.DrawElement (UnityEngine.Rect rect, System.Int32 idx, System.Boolean isActive, System.Boolean isFocused) (at Library/PackageCache/com.unity.localization@0.11.1-preview/Editor/UI/Utility/ReorderableListExtended.cs:81)
    UnityEditorInternal.ReorderableList.DoListElements (UnityEngine.Rect listRect, UnityEngine.Rect visibleRect) (at <1798d6bccd2b44b2854be2fbcc2463b3>:0)
    UnityEditorInternal.ReorderableList.DoLayoutList () (at <1798d6bccd2b44b2854be2fbcc2463b3>:0)
    UnityEditor.Localization.UI.LocalizationTableCollectionEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.localization@0.11.1-preview/Editor/UI/Tables/LocalizationTableCollectionEditor.cs:203)
    UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <a122028f8c314654ad750c3d9eb1f725>:0)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
     
  23. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Could you please file a bug report? Case 1311922 was fixed.
     
  24. PlaycorpStudios

    PlaycorpStudios

    Joined:
    Aug 2, 2016
    Posts:
    48
    Is this fixed in the latest version?
     
  25. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Which bug? We don't have any active Google sheets bugs at the moment.QA is still trying to reproduce the issue ms502040 reported. If you have found a problem then please file a bug report.
     
  26. PlaycorpStudios

    PlaycorpStudios

    Joined:
    Aug 2, 2016
    Posts:
    48
    The one that comes with this workaround.
     
  27. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Yes that's fixed
     
    PlaycorpStudios and PlaycorpEmad like this.
  28. PlaycorpStudios

    PlaycorpStudios

    Joined:
    Aug 2, 2016
    Posts:
    48
    Hi Karl,

    I updated the localization package to version 1.0.0-pre.9.

    I can pull the sheet from google fine, but pushing to sheet is not working. i'm getting this error:

    Code (CSharp):
    1. Push `TableName` to Google Sheets: Failed
    2. Object reference not set to an instance of an object
    3. Checking if sheet needs resizing: 0.52s
    4. Generating column headers: 0s
    5. Generating push data: 0s
    6. Total time: 0.52s
    7. UnityEngine.UnitySynchronizationContext:ExecuteTasks ()
    Looking forward to your help.
     
  29. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    That's a new error. Do you have some null reference somewhere? Maybe in the column configuration?
     
  30. noio

    noio

    Joined:
    Dec 17, 2013
    Posts:
    226
    I am also still experiencing this error on 0.11.1-preview, still a Null Reference on the same line (when Pulling)

    In this case it's
    colRowData[row]?.Values
    that is null

    Could work around it by replacing with the code below (another
    ?.
    null-conditional access)
    Code (CSharp):
    1. if (colRowData != null && colRowData.Count > row && colRowData[row]?.Values?.Count > valueIndex)
    Screenshot 2021-05-17 at 14.09.06.png

    But how do I make this change stick when the Unity Package Manager reverts the code?!

     
    Last edited: May 17, 2021
  31. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,227
    Could you please file a bug for this issue?
    You can move the package from the package cache into your projects Packages folder, this will then let you make changes to it
     
  32. noio

    noio

    Joined:
    Dec 17, 2013
    Posts:
    226
    Done! Case number is 1336745

    And thanks for the tip about moving the package. Now I can confirm that the patch I mentioned earlier does indeed fix this. (Adding a single "?" to line 593)


    EDIT: 1.0.0-pre.9 fixed this for me
     
    Last edited: Jun 1, 2021
    karl_jones likes this.