Search Unity

TextMesh Pro I met an error report using the TMPro when I build the windows player.

Discussion in 'UGUI & TextMesh Pro' started by watsonsong, Jun 29, 2018.

  1. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    My game is OK in editor mode, but when I build windows player, I met the following error:
    Code (CSharp):
    1. Unloading 4 Unused Serialized files (Serialized files now loaded: 16)
    2. UnloadTime: 0.219840 ms
    3. System memory in use before: 27.5 MB.
    4. System memory in use after: 27.7 MB.
    5.  
    6. Unloading 20 unused Assets to reduce memory usage. Loaded Objects now: 2016.
    7. Total: 2.416491 ms (FindLiveObjects: 0.638418 ms CreateObjectMapping: 0.041623 ms MarkObjects: 1.708897 ms  DeleteObjects: 0.027260 ms)
    8.  
    9. A script behaviour (probably TMPro.TMP_FontAsset?) has a different serialization layout when loading. (Read 13848 bytes but expected 14236 bytes)
    10. Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    11. UnityEngine.Resources:Load(String, Type)
    12. UnityEngine.Resources:Load(String)
    13. TMPro.TMP_Settings:get_instance() (at C:\Users\asus\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.textmeshpro@1.2.3\Scripts\Runtime\TMP_Settings.cs:290)
    14. TMPro.TMP_Settings:get_defaultStyleSheet() (at C:\Users\asus\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.textmeshpro@1.2.3\Scripts\Runtime\TMP_Settings.cs:240)
    15. TMPro.TMP_StyleSheet:get_instance() (at C:\Users\asus\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.textmeshpro@1.2.3\Scripts\Runtime\TMP_StyleSheet.cs:28)
    16. TMPro.TMP_StyleSheet:LoadDefaultStyleSheet() (at C:\Users\asus\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.textmeshpro@1.2.3\Scripts\Runtime\TMP_StyleSheet.cs:50)
    17. TMPro.TextMeshProUGUI:Awake() (at C:\Users\asus\AppData\Local\Unity\cache\packages\packages.unity.com\com.unity.textmeshpro@1.2.3\Scripts\Runtime\TMPro_UGUI_Private.cs:118)
    18. UnityEngine.Object:Internal_CloneSingle(Object)
    19. UnityEngine.Object:Instantiate(Object)
    20. UnityEngine.Object:Instantiate(Object, Transform, Boolean)
    21. UnityEngine.Object:Instantiate(GameObject, Transform, Boolean)
    22. UnityEngine.Object:Instantiate(GameObject, Transform)
    23.  .: (Transform)
    24. Nirvana.Pool.GameObjectPool: (‧, InstantiateQueue, Int32, Action`2)
    25. Nirvana.Pool. : (String, GameObject)
    26.  .: (String, Object)
    27. Nirvana.Pool.ObjectPool: (String, Object, 
)
    28. Nirvana.Pool. : (String, Object)
    29. Nirvana.Asset.: (AsyncOperation)
    30. UnityEngine.AsyncOperation:InvokeCompletionEvent()
    31.  
    32. [C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp line 1957]
    33. (Filename: C:/Users/asus/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.3/Scripts/Runtime/TMP_Settings.cs Line: 290)
    34.  
    35. SpriteAtlasManager.atlasRequested wasn't listened to while Shared requested.
    36. (Filename: C:\buildslave\unity\build\Runtime/2D/SpriteAtlas/SpriteAtlasManager.cpp Line: 211)
    I don't known why the TMPro.TMP_FontAsset has a different serialization layout. It put in the Resources folder.
     
  2. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    Wait...I got it, look at the following code in TMP_FontAsset:
    Code (CSharp):
    1. #if UNITY_EDITOR
    2.         /// <summary>
    3.         /// The settings used in the Font Asset Creator when this font asset was created or edited.
    4.         /// </summary>
    5.         public FontAssetCreationSettings creationSettings
    6.         {
    7.             get { return m_CreationSettings; }
    8.             set { m_CreationSettings = value; }
    9.         }
    10.         [SerializeField]
    11.         public FontAssetCreationSettings m_CreationSettings;
    12.         #endif
    Is this will cause a different layout when build the player but not run in the editor?
     
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    In which version of Unity are you getting this error?

    In terms of the platform, you mean PC, Mac & Linux Standalone player?

    What options are you using when creating that build?
     
  4. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    I am using the Standalone Windows player, both development and release version.
    I think the SerializeField can not be wrappered by the UNITY_EDITOR macro, which will cause the "different serialization layout" problem.
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I am still trying to reproduce the behavior on my end without success.

    I did check the the font asset and in the editor, the asset file does contain the additional serialized data. I also checked the same asset file in the build where Unity did correctly exclude the editor only serialized data.

    I am aware of another instance of this behavior but just can't reproduce it. Can you post an image of the settings you use when creating your build. There has to be some option / setting that is causing this.

    When Asset serialization mode are you using in Unity?
     
  6. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    BTW I am using the AssetBundle, is the asset bundle strip the editor serialized data well?
    The serializeation mode I force text, and I am using the Unity 2018b10
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I'll check on my end to see if Asset Bundles do strip the Editor only serialized data.

    On your end, see if you get the same error when using font assets not part of an Asset Bundle.
     
  8. Paul_Bronowski

    Paul_Bronowski

    Joined:
    Sep 3, 2014
    Posts:
    55
    I seem to have a repro case on Unity 2019.1.10f1 with TextMeshPro package 2.01.

    - Plays in the Editor, but (x64, Debug|Release, Windows Standalone) builds created via automation fail at runtime.

    - Nothing in my 'Assets\External\TextMesh Pro\Resources\.' folder is tagged for AssetBundle inclusion.

    - This is happening as my Loader UI Panel is being loaded from AssetBundle as the game loads up. It references TM Components.

    - Note also that I'm not using the old incremental compiler, which was causing partial class serialization ordering problems for me (resolved).

    Unloading 0 Unused Serialized files (Serialized files now loaded: 18)
    A scripted object (probably TMPro.TMP_FontAsset?) has a different serialization layout when loading. (Read 952 bytes but expected 1152 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    0x00007FFB95848C0C (UnityPlayer) PAL_Memory_Free
    0x00007FFB9584B929 (UnityPlayer) PAL_Memory_Free
    0x00007FFB9583C988 (UnityPlayer) PAL_Memory_Free
    0x00007FFB9689C083 (UnityPlayer) UnityMain
    0x00007FFB96281F4C (UnityPlayer) UnityMain
    0x00007FFB96282C46 (UnityPlayer) UnityMain
    0x00007FFB9627498E (UnityPlayer) UnityMain
    0x00007FFB962738A1 (UnityPlayer) UnityMain
    0x00007FFB9627261A (UnityPlayer) UnityMain
    0x00007FFB96274C47 (UnityPlayer) UnityMain
    0x00007FFB961CBD47 (UnityPlayer) UnityMain
    0x00007FFB9631BF40 (UnityPlayer) UnityMain
    0x00007FFB747BE3D5 (GameAssembly) [unityengine.coremodule2.cpp:24369] Resources_Load_mF0FA033BF566CDDA6A0E69BB97283B44C40726E7
    0x00007FFB7010C2B4 (GameAssembly) [genericmethods14.cpp:63202] Resources_Load_TisRuntimeObject_m5DBFEC24E0DC9FC8734E858A489BC7B8B64B0BFF_gshared
    0x00007FFB6F53CDF2 (GameAssembly) [unity.textmeshpro2.cpp:18119] Resources_Load_TisTMP_Settings_t1CCF2DFCF66223CC1AC404F9AEE3E257BA37255A_mD35E673D423926E91EA022BBC96D788B74AF5F04
    0x00007FFB71AC8A6B (GameAssembly) [unity.textmeshpro2.cpp:28056] TMP_Settings_get_instance_mED364A86AB8411EEB0C7A458A66484B1C98B7CB9
    0x00007FFB71AC9825 (GameAssembly) [unity.textmeshpro2.cpp:27336] TMP_Settings_get_warningsDisabled_mC51846D5330AE96386118085E08E55398EAF29BB
    0x00007FFB705DFFC2 (GameAssembly) [unity.textmeshpro3.cpp:43070] TMP_Text_GetSpecialCharacters_m4CBD72F26A71E4E76D89FC43BF3AB0CC37E1D5C5
    0x00007FFB71B905FD (GameAssembly) [unity.textmeshpro5.cpp:16328] TextMeshProUGUI_LoadFontAsset_m0579B3598C6845AC3A517BD3FF6D091BCFB9FD9B
    0x00007FFB6F35AD79 (GameAssembly) [game35.cpp:51] VirtActionInvoker0::Invoke
    0x00007FFB71B3F8AB (GameAssembly) [unity.textmeshpro5.cpp:15403] TextMeshProUGUI_Awake_m4ABE59654DE8040D486136CC26F91B31337F9B6B
    0x00007FFB6F12803B (GameAssembly) [il2cppinvokertable.cpp:71072] RuntimeInvoker_TrueVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017
    0x00007FFB6FCC4F7B (GameAssembly) [runtime.cpp:542] il2cpp::vm::Runtime::Invoke
    0x00007FFB6FB9071F (GameAssembly) [il2cpp-api.cpp:1013] il2cpp_runtime_invoke
    0x00007FFB96223CC6 (UnityPlayer) UnityMain
    0x00007FFB96236131 (UnityPlayer) UnityMain
    0x00007FFB96236263 (UnityPlayer) UnityMain
    0x00007FFB96267C85 (UnityPlayer) UnityMain
    0x00007FFB9623A2A8 (UnityPlayer) UnityMain
    0x00007FFB962398FD (UnityPlayer) UnityMain
    0x00007FFB96239CCC (UnityPlayer) UnityMain
    0x00007FFB962866DA (UnityPlayer) UnityMain
    0x00007FFB95C7D3DE (UnityPlayer) UnityMain
    0x00007FFB95C7DC49 (UnityPlayer) UnityMain
    0x00007FFB962D1F6A (UnityPlayer) UnityMain
    0x00007FFB743EE70B (GameAssembly) [unityengine.coremodule1.cpp:25397] Object_Internal_CloneSingle_m4231A0B9138AC40B76655B772F687CC7E6160C06
    0x00007FFB701070AF (GameAssembly) [genericmethods14.cpp:62334] Object_Instantiate_TisRuntimeObject_m4566F033303F52A6D430A06E5FA2D29E2A8D6ED3_gshared
    0x00007FFB6F3255E2 (GameAssembly) [particleplayground1.cpp:15730] Object_Instantiate_TisGameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F_m598037C6F246E67DB3E38DFBB1F44D4D9921A85E
    0x00007FFB75882F20 (GameAssembly) [generics2.cpp:14222] AssetReference_1_InstantiateInternal_m031925F08FB63C86DBE407AADB79606320B29EE8_gshared
    0x00007FFB75887B89 (GameAssembly) [generics2.cpp:14121] AssetReference_1_Instantiate_m09B395543789E3661799073894379FDEBF2458C9_gshared
    0x00007FFB6F37523E (GameAssembly) [game7.cpp:73] VirtFuncInvoker2<Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *,Type_t *,bool>::Invoke
    0x00007FFB70233F07 (GameAssembly) [game7.cpp:46906] AssetService_Instantiate_m648AEBC910FAD6FDB169830ED359A61EB12A3B63
    0x00007FFB70E70513 (GameAssembly) [game49.cpp:42941] UIElement_OnShow_m1467AA39E7466691AA2F3463EA695743935B96B4
    0x00007FFB6F35AD79 (GameAssembly) [game35.cpp:51] VirtActionInvoker0::Invoke
    0x00007FFB70E74278 (GameAssembly) [game49.cpp:42254] UIElement_Show_mD62BC51E67BA29A9231CD0AB317C3C4ABA1772AD
    0x00007FFB6F35A763 (GameAssembly) [game35.cpp:41] VirtActionInvoker1<bool>::Invoke
    0x00007FFB71C36FC5 (GameAssembly) [genericmethods15.cpp:27419] HUD_ShowUIElement_TisRuntimeObject_m313EFBCAE19E24E01AB85E62A2D0C1915AFC0CDB_gshared
    0x00007FFB6F3B31EA (GameAssembly) [game29.cpp:30440] HUD_ShowUIElement_TisLoaderUIElement_t8463564E5C961ACFC2BA27DBEBC03A3D0A60DD35_m14931F200FEA0F3CFA1A70D0E929754EF652350E
    0x00007FFB705810F4 (GameAssembly) [game29.cpp:41325] LoaderService_ShowLoaderUIElement_m70D04CE3CCDC6F7915D798B68DAECC1F12ED1937
    0x00007FFB705B0060 (GameAssembly) [game29.cpp:48747] U3CLoaderUIFiberU3Ed__25_MoveNext_m4A7522ACEE81568DE6817571E5E29FD9CF5C50A3
    0x00007FFB6F324213 (GameAssembly) [particleplayground1.cpp:52] InterfaceFuncInvoker0<bool>::Invoke
    0x00007FFB7154DF8A (GameAssembly) [game18.cpp:32250] U3CWrapperFiberU3Ed__46_MoveNext_m8D10D753C1F4FBDF93028775DD47503B86D16E22
    0x00007FFB6F324213 (GameAssembly) [particleplayground1.cpp:52] InterfaceFuncInvoker0<bool>::Invoke
    0x00007FFB747C6672 (GameAssembly) [unityengine.coremodule2.cpp:27548] SetupCoroutine_InvokeMoveNext_m9106BA4E8AE0E794B17F184F1021A53F1D071F31
    0x00007FFB6F163F8D (GameAssembly) [il2cppinvokertable.cpp:78352] RuntimeInvoker_FalseVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017_RuntimeObject_IntPtr_t
    0x00007FFB6FCC4F7B (GameAssembly) [runtime.cpp:542] il2cpp::vm::Runtime::Invoke
    0x00007FFB6FB9071F (GameAssembly) [il2cpp-api.cpp:1013] il2cpp_runtime_invoke
    0x00007FFB96223CC6 (UnityPlayer) UnityMain
    0x00007FFB96236131 (UnityPlayer) UnityMain
    0x00007FFB9624096A (UnityPlayer) UnityMain
    0x00007FFB95C81D9C (UnityPlayer) UnityMain
    0x00007FFB95F30202 (UnityPlayer) UnityMain
    0x00007FFB95F1E9A7 (UnityPlayer) UnityMain
    0x00007FFB95F1EA75 (UnityPlayer) UnityMain
    0x00007FFB95F2217F (UnityPlayer) UnityMain
    0x00007FFB958717E2 (UnityPlayer) PAL_Memory_Free
    0x00007FFB9586FFEA (UnityPlayer) PAL_Memory_Free
    0x00007FFB95874789 (UnityPlayer) PAL_Memory_Free
    0x00007FFB958763FB (UnityPlayer) UnityMain
    0x00007FF657D711F2 (RoC)
    0x00007FFBED057BD4 (KERNEL32) BaseThreadInitThunk
    0x00007FFBED52CE71 (ntdll) RtlUserThreadStart

    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializedFile.cpp Line: 2012)
    The file 'D:/TableTop1/Drops/RealmsOfConquest/RealmsOfConquest_1.0.3939.0/Debug/x64/Layout/RoC_Data/resources.assets' is corrupted! Remove it and launch unity again!
    [Position out of bounds!]
    0x00007FFB95848C0C (UnityPlayer) PAL_Memory_Free
    0x00007FFB9584B929 (UnityPlayer) PAL_Memory_Free
    0x00007FFB9583C988 (UnityPlayer) PAL_Memory_Free
    0x00007FFB9689C083 (UnityPlayer) UnityMain
    0x00007FFB95F783C2 (UnityPlayer) UnityMain
    0x00007FFB95F7AAB5 (UnityPlayer) UnityMain
    0x00007FFB95404896 (UnityPlayer)
    0x00007FFB96255E0F (UnityPlayer) UnityMain
    0x00007FFB96263229 (UnityPlayer) UnityMain
    0x00007FFB962516D0 (UnityPlayer) UnityMain
    0x00007FFB9625772F (UnityPlayer) UnityMain
    0x00007FFB962578B2 (UnityPlayer) UnityMain
    0x00007FFB96267AFD (UnityPlayer) UnityMain
    0x00007FFB96241DB9 (UnityPlayer) UnityMain
    0x00007FFB96282C19 (UnityPlayer) UnityMain
    0x00007FFB9627498E (UnityPlayer) UnityMain
    0x00007FFB962738A1 (UnityPlayer) UnityMain
    0x00007FFB9627261A (UnityPlayer) UnityMain
    0x00007FFB96274C47 (UnityPlayer) UnityMain
    0x00007FFB961CBD47 (UnityPlayer) UnityMain
    0x00007FFB9631BF40 (UnityPlayer) UnityMain
    0x00007FFB747BE3D5 (GameAssembly) [unityengine.coremodule2.cpp:24369] Resources_Load_mF0FA033BF566CDDA6A0E69BB97283B44C40726E7
    0x00007FFB7010C2B4 (GameAssembly) [genericmethods14.cpp:63202] Resources_Load_TisRuntimeObject_m5DBFEC24E0DC9FC8734E858A489BC7B8B64B0BFF_gshared
    0x00007FFB6F53CDF2 (GameAssembly) [unity.textmeshpro2.cpp:18119] Resources_Load_TisTMP_Settings_t1CCF2DFCF66223CC1AC404F9AEE3E257BA37255A_mD35E673D423926E91EA022BBC96D788B74AF5F04
    0x00007FFB71AC8A6B (GameAssembly) [unity.textmeshpro2.cpp:28056] TMP_Settings_get_instance_mED364A86AB8411EEB0C7A458A66484B1C98B7CB9
    0x00007FFB71AC9825 (GameAssembly) [unity.textmeshpro2.cpp:27336] TMP_Settings_get_warningsDisabled_mC51846D5330AE96386118085E08E55398EAF29BB
    0x00007FFB705DFFC2 (GameAssembly) [unity.textmeshpro3.cpp:43070] TMP_Text_GetSpecialCharacters_m4CBD72F26A71E4E76D89FC43BF3AB0CC37E1D5C5
    0x00007FFB71B905FD (GameAssembly) [unity.textmeshpro5.cpp:16328] TextMeshProUGUI_LoadFontAsset_m0579B3598C6845AC3A517BD3FF6D091BCFB9FD9B
    0x00007FFB6F35AD79 (GameAssembly) [game35.cpp:51] VirtActionInvoker0::Invoke
    0x00007FFB71B3F8AB (GameAssembly) [unity.textmeshpro5.cpp:15403] TextMeshProUGUI_Awake_m4ABE59654DE8040D486136CC26F91B31337F9B6B
    0x00007FFB6F12803B (GameAssembly) [il2cppinvokertable.cpp:71072] RuntimeInvoker_TrueVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017
    0x00007FFB6FCC4F7B (GameAssembly) [runtime.cpp:542] il2cpp::vm::Runtime::Invoke
    0x00007FFB6FB9071F (GameAssembly) [il2cpp-api.cpp:1013] il2cpp_runtime_invoke
    0x00007FFB96223CC6 (UnityPlayer) UnityMain
    0x00007FFB96236131 (UnityPlayer) UnityMain
    0x00007FFB96236263 (UnityPlayer) UnityMain
    0x00007FFB96267C85 (UnityPlayer) UnityMain
    0x00007FFB9623A2A8 (UnityPlayer) UnityMain
    0x00007FFB962398FD (UnityPlayer) UnityMain
    0x00007FFB96239CCC (UnityPlayer) UnityMain
    0x00007FFB962866DA (UnityPlayer) UnityMain
    0x00007FFB95C7D3DE (UnityPlayer) UnityMain
    0x00007FFB95C7DC49 (UnityPlayer) UnityMain
    0x00007FFB962D1F6A (UnityPlayer) UnityMain
    0x00007FFB743EE70B (GameAssembly) [unityengine.coremodule1.cpp:25397] Object_Internal_CloneSingle_m4231A0B9138AC40B76655B772F687CC7E6160C06
    0x00007FFB701070AF (GameAssembly) [genericmethods14.cpp:62334] Object_Instantiate_TisRuntimeObject_m4566F033303F52A6D430A06E5FA2D29E2A8D6ED3_gshared
    0x00007FFB6F3255E2 (GameAssembly) [particleplayground1.cpp:15730] Object_Instantiate_TisGameObject_tBD1244AD56B4E59AAD76E5E7C9282EC5CE434F0F_m598037C6F246E67DB3E38DFBB1F44D4D9921A85E
    0x00007FFB75882F20 (GameAssembly) [generics2.cpp:14222] AssetReference_1_InstantiateInternal_m031925F08FB63C86DBE407AADB79606320B29EE8_gshared
    0x00007FFB75887B89 (GameAssembly) [generics2.cpp:14121] AssetReference_1_Instantiate_m09B395543789E3661799073894379FDEBF2458C9_gshared
    0x00007FFB6F37523E (GameAssembly) [game7.cpp:73] VirtFuncInvoker2<Object_tAE11E5E46CD5C37C9F3E8950C00CD8B45666A2D0 *,Type_t *,bool>::Invoke
    0x00007FFB70233F07 (GameAssembly) [game7.cpp:46906] AssetService_Instantiate_m648AEBC910FAD6FDB169830ED359A61EB12A3B63
    0x00007FFB70E70513 (GameAssembly) [game49.cpp:42941] UIElement_OnShow_m1467AA39E7466691AA2F3463EA695743935B96B4
    0x00007FFB6F35AD79 (GameAssembly) [game35.cpp:51] VirtActionInvoker0::Invoke
    0x00007FFB70E74278 (GameAssembly) [game49.cpp:42254] UIElement_Show_mD62BC51E67BA29A9231CD0AB317C3C4ABA1772AD
    0x00007FFB6F35A763 (GameAssembly) [game35.cpp:41] VirtActionInvoker1<bool>::Invoke
    0x00007FFB71C36FC5 (GameAssembly) [genericmethods15.cpp:27419] HUD_ShowUIElement_TisRuntimeObject_m313EFBCAE19E24E01AB85E62A2D0C1915AFC0CDB_gshared
    0x00007FFB6F3B31EA (GameAssembly) [game29.cpp:30440] HUD_ShowUIElement_TisLoaderUIElement_t8463564E5C961ACFC2BA27DBEBC03A3D0A60DD35_m14931F200FEA0F3CFA1A70D0E929754EF652350E
    0x00007FFB705810F4 (GameAssembly) [game29.cpp:41325] LoaderService_ShowLoaderUIElement_m70D04CE3CCDC6F7915D798B68DAECC1F12ED1937
    0x00007FFB705B0060 (GameAssembly) [game29.cpp:48747] U3CLoaderUIFiberU3Ed__25_MoveNext_m4A7522ACEE81568DE6817571E5E29FD9CF5C50A3
    0x00007FFB6F324213 (GameAssembly) [particleplayground1.cpp:52] InterfaceFuncInvoker0<bool>::Invoke
    0x00007FFB7154DF8A (GameAssembly) [game18.cpp:32250] U3CWrapperFiberU3Ed__46_MoveNext_m8D10D753C1F4FBDF93028775DD47503B86D16E22
    0x00007FFB6F324213 (GameAssembly) [particleplayground1.cpp:52] InterfaceFuncInvoker0<bool>::Invoke
    0x00007FFB747C6672 (GameAssembly) [unityengine.coremodule2.cpp:27548] SetupCoroutine_InvokeMoveNext_m9106BA4E8AE0E794B17F184F1021A53F1D071F31
    0x00007FFB6F163F8D (GameAssembly) [il2cppinvokertable.cpp:78352] RuntimeInvoker_FalseVoid_t22962CB4C05B1D89B55A6E1139F0E87A90987017_RuntimeObject_IntPtr_t
    0x00007FFB6FCC4F7B (GameAssembly) [runtime.cpp:542] il2cpp::vm::Runtime::Invoke
    0x00007FFB6FB9071F (GameAssembly) [il2cpp-api.cpp:1013] il2cpp_runtime_invoke
    0x00007FFB96223CC6 (UnityPlayer) UnityMain
    0x00007FFB96236131 (UnityPlayer) UnityMain
    0x00007FFB9624096A (UnityPlayer) UnityMain
    0x00007FFB95C81D9C (UnityPlayer) UnityMain
    0x00007FFB95F30202 (UnityPlayer) UnityMain
    0x00007FFB95F1E9A7 (UnityPlayer) UnityMain
    0x00007FFB95F1EA75 (UnityPlayer) UnityMain
    0x00007FFB95F2217F (UnityPlayer) UnityMain
    0x00007FFB958717E2 (UnityPlayer) PAL_Memory_Free
    0x00007FFB9586FFEA (UnityPlayer) PAL_Memory_Free
    0x00007FFB95874789 (UnityPlayer) PAL_Memory_Free
    0x00007FFB958763FB (UnityPlayer) UnityMain
    0x00007FF657D711F2 (RoC)
    0x00007FFBED057BD4 (KERNEL32) BaseThreadInitThunk
    0x00007FFBED52CE71 (ntdll) RtlUserThreadStart

    (Filename: C:\buildslave\unity\build\Runtime/Serialize/SerializationCaching/CachedReader.cpp Line: 220)
     
  9. Paul_Bronowski

    Paul_Bronowski

    Joined:
    Sep 3, 2014
    Posts:
    55
    Here is my Builder.cs class (a tad messy, currently). You had asked for build settings, above...

    Code (CSharp):
    1.  
    2. // If defined, will use UnityEditor.Build.Pipeline instead of the legacy build system
    3. // #define USE_SBP
    4.  
    5. using UnityEditor;
    6. using System.Linq;
    7. using System.Text;
    8. using System.IO;
    9. using UnityEngine;
    10. //using UnityEditor.Build.Pipeline;
    11. //#if USE_SBP
    12. //using UnityEditor.Build.Pipeline.Interfaces;
    13. //#endif
    14.  
    15. namespace Game.Build
    16. {
    17.     /// <summary>
    18.     /// Supported build configuration types
    19.     /// </summary>
    20.     public enum BuildConfiguration
    21.     {
    22.         Debug = 0,
    23.         Release = 1
    24.     }
    25.  
    26.  
    27.     /// <summary>
    28.     /// Build the product
    29.     /// </summary>
    30.     public class Builder
    31.     {
    32.         private static char[] _TrimChars = { ' ', '\t', '"' };
    33.  
    34.  
    35.         private static string[] GetScenesToBuild()
    36.         {
    37.             return (from scene in EditorBuildSettings.scenes where scene.enabled select scene.path).ToArray();
    38.         }
    39.  
    40.  
    41.         /// <summary>
    42.         /// Get's the -buildPath argument from the command line
    43.         /// </summary>
    44.         /// <returns></returns>
    45.         private static string GetBuildTargetPathFromCommandLine()
    46.         {
    47.             string buildPath = string.Empty;
    48.             string[] args = System.Environment.GetCommandLineArgs();
    49.             for (int i = 0; i < args.Length; i++)
    50.             {
    51.                 // We're looking for "-buildPath" switch
    52.                 if (string.Compare(args[i].Trim(Builder._TrimChars), "-buildPath", true) != 0)
    53.                     continue;
    54.                 // Next argument should be the path
    55.                 if (i + 1 > args.Length)
    56.                     throw new System.ArgumentException("Expected a path argument to follow the -buildPath argument.");
    57.                 i++;
    58.                 buildPath = args[i].Trim(Builder._TrimChars);
    59.                 // TODO: Validate buildPath
    60.                 break;
    61.             }
    62.             if (string.IsNullOrEmpty(buildPath))
    63.                 throw new System.ArgumentException("Expected -buildPath {path} argument");
    64.  
    65.             return buildPath;
    66.         }
    67.  
    68.  
    69.         /// <summary>
    70.         /// Gets the -buildConfiguration argument from the command line
    71.         /// </summary>
    72.         /// <returns></returns>
    73.         private static BuildConfiguration GetBuildConfigurationFromCommandLine()
    74.         {
    75.             string buildConfigurationString = string.Empty;
    76.             string[] args = System.Environment.GetCommandLineArgs();
    77.             for (int i = 0; i < args.Length; i++)
    78.             {
    79.                 // We're looking for "-buildConfiguration" switch
    80.                 if (string.Compare(args[i].Trim(Builder._TrimChars), "-buildConfiguration", true) != 0)
    81.                     continue;
    82.                 // Next argument should be the path
    83.                 if (i + 1 > args.Length)
    84.                     throw new System.ArgumentException("Expected a path argument to follow the -buildConfiguration argument.");
    85.                 i++;
    86.                 buildConfigurationString = args[i].Trim(Builder._TrimChars);
    87.                 // TODO: Validate buildPath
    88.                 break;
    89.             }
    90.             if (string.IsNullOrEmpty(buildConfigurationString))
    91.                 throw new System.ArgumentException("Expected -buildConfiguration {Debug | Release} argument");
    92.  
    93.             switch (buildConfigurationString)
    94.             {
    95.                 case "Debug":
    96.                     return BuildConfiguration.Debug;
    97.                 case "Release":
    98.                     return BuildConfiguration.Release;
    99.                 default:
    100.                     throw new System.ArgumentException(string.Format("-buildConfiguration '{0}' is currently unsupported.", buildConfigurationString));
    101.             }
    102.  
    103.         }
    104.  
    105.  
    106.         /// <summary>
    107.         /// Gets the -buildTarget argument from the command line
    108.         /// </summary>
    109.         /// <returns></returns>
    110.         private static void GetBuildTargetFromCommandLine(out BuildTarget      buildTarget,
    111.                                                           out BuildTargetGroup buildTargetGroup)
    112.         {
    113.             string buildTargetString = string.Empty;
    114.             string[] args = System.Environment.GetCommandLineArgs();
    115.             for (int i = 0; i < args.Length; i++)
    116.             {
    117.                 // We're looking for "-buildTarget" switch
    118.                 if (string.Compare(args[i].Trim(Builder._TrimChars), "-buildTarget", true) != 0)
    119.                     continue;
    120.                 // Next argument should be the path
    121.                 if (i + 1 > args.Length)
    122.                     throw new System.ArgumentException("Expected a path argument to follow the -buildTarget argument.");
    123.                 i++;
    124.                 buildTargetString = args[i].Trim(Builder._TrimChars);
    125.                 // TODO: Validate buildPath
    126.                 break;
    127.             }
    128.             if (string.IsNullOrEmpty(buildTargetString))
    129.                 throw new System.ArgumentException("Expected -buildTarget {win32 | win64 | Android | iOS | WindowsStoreApps | XboxOne} argument");
    130.  
    131.             switch (buildTargetString)
    132.             {
    133.                 case "win32":
    134.                     buildTarget = BuildTarget.StandaloneWindows;
    135.                     buildTargetGroup = BuildTargetGroup.Standalone;
    136.                     break;
    137.  
    138.                 case "win64":
    139.                     buildTarget = BuildTarget.StandaloneWindows64;
    140.                     buildTargetGroup = BuildTargetGroup.Standalone;
    141.                     break;
    142.  
    143.                 case "Android":
    144.                     buildTarget = BuildTarget.Android;
    145.                     buildTargetGroup = BuildTargetGroup.Android;
    146.                     break;
    147.  
    148.                 case "iOS":
    149.                     buildTarget = BuildTarget.iOS;
    150.                     buildTargetGroup = BuildTargetGroup.iOS;
    151.                     break;
    152.  
    153.                 case "WindowsStoreApps":
    154.                     buildTarget = BuildTarget.WSAPlayer;
    155.                     buildTargetGroup = BuildTargetGroup.WSA;
    156.                     break;
    157.  
    158.                 case "XboxOne":
    159.                     buildTarget = BuildTarget.XboxOne;
    160.                     buildTargetGroup = BuildTargetGroup.XboxOne;
    161.                     break;
    162.  
    163.                 default:
    164.                     throw new System.ArgumentException(string.Format("-buildTarget '{0}' is currently unsupported.", buildTargetString));
    165.             }
    166.            
    167.         }
    168.  
    169.  
    170.         /// <summary>
    171.         /// Builds the product for the current configuration
    172.         /// </summary>
    173.         public static void Build()
    174.         {
    175.             try
    176.             {
    177.                 BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions();
    178.  
    179.                 // Get buildTarget (will throw an exception on failure)
    180.                 BuildTarget buildTarget;
    181.                 BuildTargetGroup buildTargetGroup;
    182.                 Builder.GetBuildTargetFromCommandLine(out buildTarget, out buildTargetGroup);
    183.                 buildPlayerOptions.target = buildTarget;
    184.                 buildPlayerOptions.targetGroup = buildTargetGroup;
    185.  
    186.                 // Get buildConfiguration (will throw an exception on failure)
    187.                 BuildConfiguration buildConfiguration = Builder.GetBuildConfigurationFromCommandLine();
    188.  
    189.                 // Set buildOptions
    190.                 //Il2CppCompilerConfiguration savedIl2CppCompilerConfiguration = PlayerSettings.GetIl2CppCompilerConfiguration(buildTargetGroup);
    191.                 PlayerSettings.SetIncrementalIl2CppBuild(buildTargetGroup, true);
    192.                 buildPlayerOptions.options = BuildOptions.StrictMode;
    193.                 if (buildConfiguration == BuildConfiguration.Debug)
    194.                 {
    195.                     buildPlayerOptions.options |= BuildOptions.Development | BuildOptions.AllowDebugging;
    196.                     PlayerSettings.SetIl2CppCompilerConfiguration(buildTargetGroup, Il2CppCompilerConfiguration.Debug);
    197.                     PlayerSettings.SetManagedStrippingLevel(buildTargetGroup, ManagedStrippingLevel.Low);
    198.                 }
    199.                 else
    200.                 {
    201.                     // TODO: Test/verify this works
    202.                     PlayerSettings.SetIl2CppCompilerConfiguration(buildTargetGroup, Il2CppCompilerConfiguration.Master);
    203.                     // TODO: Test/verify this works. We may need a custom link.xml file, etc.
    204.                     // See https://docs.unity3d.com/ScriptReference/ManagedStrippingLevel.html
    205.                     PlayerSettings.SetManagedStrippingLevel(buildTargetGroup, ManagedStrippingLevel.High);
    206.                 }
    207.  
    208.                 // Get our build paths (will throw an exception on failure)
    209.                 string buildTargetPath = Path.GetFullPath(Builder.GetBuildTargetPathFromCommandLine());
    210.                 if (!Directory.Exists(buildTargetPath))
    211.                     Directory.CreateDirectory(buildTargetPath);
    212.  
    213.                 string assetBundleBuildPath = Path.GetFullPath(Path.Combine(Path.Combine(Application.dataPath, @"..\AssetBundles"), AssetBundles.Utility.GetPlatformName()));
    214.                 if (!Directory.Exists(assetBundleBuildPath))
    215.                     Directory.CreateDirectory(assetBundleBuildPath);
    216.  
    217.                 string assetBundleTargetPath = Path.GetFullPath(Path.Combine(buildTargetPath, @"RoC_Data\StreamingAssets"));
    218.                 if (!Directory.Exists(assetBundleTargetPath))
    219.                     Directory.CreateDirectory(assetBundleTargetPath);
    220.  
    221.                 // Player Compression
    222.                 // TODO: Maybe for Mobile?
    223.                 //switch (buildPlayerOptions.target)
    224.                 //{
    225.                 //    case BuildTarget.StandaloneLinux:
    226.                 //    case BuildTarget.StandaloneLinux64:
    227.                 //    case BuildTarget.StandaloneLinuxUniversal:
    228.                 //    case BuildTarget.StandaloneOSX:
    229.                 //    case BuildTarget.StandaloneWindows:
    230.                 //    case BuildTarget.StandaloneWindows64:
    231.                 //    case BuildTarget.WebGL:
    232.                 //        // Use chunk-based LZ4 compression when building the Player.
    233.                 //        buildPlayerOptions.options |= BuildOptions.CompressWithLz4;
    234.                 //        // Use chunk-based LZ4 high-compression when building the Player.
    235.                 //        // buildPlayerOptions.options |= BuildOptions.CompressWithLz4HC;
    236.                 //        break;
    237.                 //    default:
    238.                 //        break;
    239.                 //}
    240.  
    241.                 // TODO: Test Assemblies
    242.                 // buildPlayerOptions.options |= BuildOptions.IncludeTestAssemblies;
    243.  
    244.                 // Target exe
    245.                 if (buildPlayerOptions.target == BuildTarget.Android)
    246.                     buildPlayerOptions.locationPathName = Path.GetFullPath(Path.Combine(buildTargetPath, @"RoC.apk"));
    247.                 else
    248.                     buildPlayerOptions.locationPathName = Path.GetFullPath(Path.Combine(buildTargetPath, @"RoC.exe"));
    249.  
    250.                 // Get scenesToBuild. Note: Only the root scene. All other scenes are streamed, but we leave them enabled for purpose of running in-editor.
    251.                 //string[] scenesToBuild = new string[EditorBuildSettings.scenes.Length];
    252.                 //for (int i =0, iEnd = scenesToBuild.Length; i < iEnd; i++)
    253.                 //{
    254.                 //    scenesToBuild[i] = EditorBuildSettings.scenes[i].path;
    255.                 //}
    256.                 string[] scenesToBuild = new string[] { EditorBuildSettings.scenes[0].path };
    257.                 buildPlayerOptions.scenes = scenesToBuild;
    258.  
    259.                 StringBuilder sb = new StringBuilder();
    260.  
    261.                 // Report what we are building
    262.                 sb.AppendLine("Building for the following configuration...");
    263.                 sb.AppendLine(string.Format("  BuildTargetPath             = {0}", buildTargetPath));
    264.                 sb.AppendLine(string.Format("  AssetBundleBuildPath        = {0}", assetBundleBuildPath));
    265.                 sb.AppendLine(string.Format("  AssetBundleTargetPath       = {0}", assetBundleTargetPath));
    266.                 sb.AppendLine(string.Format("  Target                      = {0}", buildPlayerOptions.target.ToString()));
    267.                 sb.AppendLine(string.Format("  Configuration               = {0}", buildConfiguration.ToString()));
    268.                 sb.AppendLine(string.Format("  Options                     = {0}", buildPlayerOptions.options.ToString()));
    269.                 sb.AppendLine(string.Format("  TargetExecutable            = {0}", buildPlayerOptions.locationPathName));
    270.                 sb.AppendLine(string.Format("  Il2CppCompilerConfiguration = {0}", PlayerSettings.GetIl2CppCompilerConfiguration(buildTargetGroup).ToString()));
    271.                 sb.AppendLine(string.Format("  IncrementalIl2CppBuild      = {0}", PlayerSettings.GetIncrementalIl2CppBuild(buildTargetGroup).ToString()));
    272.                 sb.AppendLine(string.Format("  ManagedStrippingLevel       = {0}", PlayerSettings.GetManagedStrippingLevel(buildTargetGroup).ToString()));
    273.  
    274.                 sb.Append(string.Format("  Persistent Scenes To Build = "));
    275.                 foreach (string scene in buildPlayerOptions.scenes)
    276.                     sb.Append(scene + ",");
    277.                 sb.AppendLine();
    278.                 System.Console.Write(sb.ToString());
    279.  
    280.                 // Build AssetBundles
    281. #if USE_SBP
    282.                 IBundleBuildParameters buildParams = new BundleBuildParameters(buildPlayerOptions.target, buildPlayerOptions.targetGroup, assetBundleBuildPath);
    283.                 // TODO: Get this working the new way
    284.                 IBundleBuildContent buildContent = GetBundleContent();
    285.                 IBundleBuildResults results;
    286.                 ReturnCode retCode = ContentPipeline.BuildAssetBundles(buildParams, buildContent, out results);
    287. #else
    288.                 AssetBundleManifest assetBundleManifest = BuildPipeline.BuildAssetBundles(assetBundleBuildPath,
    289.                                                                                           BuildAssetBundleOptions.ChunkBasedCompression | BuildAssetBundleOptions.StrictMode,
    290.                                                                                           buildPlayerOptions.target);
    291.                 string assetBundleManifestName = assetBundleManifest.GetAllAssetBundles()[0];
    292.                 buildPlayerOptions.assetBundleManifestPath = Path.GetFullPath(Path.Combine(assetBundleBuildPath, assetBundleManifestName));
    293. #endif // USE_SBP
    294.  
    295.                 // Build the player
    296.                 // TODO: USE_SBP?
    297.                 buildPlayerOptions.assetBundleManifestPath = Path.GetFullPath(Path.Combine(assetBundleBuildPath, assetBundleManifestName));
    298.  
    299.                 BuildPipeline.BuildPlayer(buildPlayerOptions);
    300.  
    301.                 // TODO: Belongs in finally
    302.                 //PlayerSettings.SetIl2CppCompilerConfiguration(buildTargetGroup, savedIl2CppCompilerConfiguration);
    303.                 //PlayerSettings.SetIncrementalIl2CppBuild(buildTargetGroup, TODO);
    304.                 //PlayerSettings.SetManagedStrippingLevel(buildtargetGroup, TODO)
    305.  
    306.             }
    307.             catch (System.Exception e)
    308.             {
    309.                 System.Console.WriteLine(e.ToString());
    310.                 throw e;
    311.             }
    312.  
    313.         }
    314.  
    315.     }
    316.  
    317. }
     
  10. Paul_Bronowski

    Paul_Bronowski

    Joined:
    Sep 3, 2014
    Posts:
    55
    Indeed, that is the workaround...

    packages\packages.unity.com\com.unity.textmeshpro@2.0.1\Scripts\Runtime\TMP_FontAsset.cs


    Code (CSharp):
    1.         // BEGIN: WARPFORGED_CUSTOM
    2.         /*
    3.         #if UNITY_EDITOR
    4.         */
    5.         // END: WARPFORGED_CUSTOM
    6.         /// <summary>
    7.         /// Persistent reference to the source font file maintained in the editor.
    8.         /// </summary>
    9.         [SerializeField]
    10.         internal Font m_SourceFontFile_EditorRef;
    11.         // BEGIN: WARPFORGED_CUSTOM
    12.         /*
    13.         #endif
    14.         */
    15.         // END: WARPFORGED_CUSTOM
     
  11. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    This issue is likely related to a bug with the build system where the Editor assembly is incorrectly used in the build.

    Since the font asset includes (1) serialized field in the Editor which correctly gets stripped from the asset but still referenced by the Editor assembly we get the error message about "... has a different serialization layout when loading. (Read 952 bytes but expected 1152 bytes)".

    In one of the cases I reviewed, the user was creating a Standalone build which would crash on startup. By simply changing the Architecture from x86_64 to x86 and then without building switching back to x86_64 results in Unity re-syncing / updating the assembly references which resolves the issue.

    This issue has been fixed in 2019.3.x and currently planned to be back ported to 2018.4.

    Until then, there might be a way you can force this re-sync of assemblies in your build process or alternatively and until the fix lands in the version of Unity you are using, you can remove the #If UNITY_EDITOR from the following field in the TMP_FontAsset.cs

    Code (csharp):
    1.  
    2.  #if UNITY_EDITOR
    3.  /// <summary>
    4.  /// Persistent reference to the source font file maintained in the editor.
    5.  /// </summary>
    6.  [SerializeField]
    7.  internal Font m_SourceFontFile_EditorRef;
    8. #endif
    9.  
    The affect of this change will force the source font file to be included in the build even if the font asset is static. When font assets are set to dynamic, the source font file is included in the build.
     
  12. Paul_Bronowski

    Paul_Bronowski

    Joined:
    Sep 3, 2014
    Posts:
    55
    Thanks. Alternately, are there intermediates I could delete in Library\... (short of removing the entire folder), before I build? Did I hear you say nuking Assemblies/Intermediates folders before building will possibly resolve it?
     
    Last edited: Jul 19, 2019
  13. Hellium

    Hellium

    Joined:
    Sep 25, 2014
    Posts:
    43
    Hello @Stephan_B,

    Do you have any news about this?

    My game crashes on iOS when the scene containing the TextMeshPro gameObject referencing the font asset is loaded. I suspect my problem and Paul_Bronowski's are related. I can't change the
    TMP_FontAsset.cs
    because the app is built from a C.I service.

    - TextMeshPro version : 2.0.1
    - Unity version : 2019.1.13f1

    Stacktrace:

    Code (csharp):
    1. Crashed: Loading.PreloadManager
    2.                         0x103885ce4 il2cpp::vm::Array::NewSpecific(Il2CppClass*, unsigned long) + 55 (Object.cpp:55)
    3.                         0x10324985c scripting_array_new(ScriptingClassPtr, unsigned long, unsigned long) + 546 (ScriptingApi_Il2Cpp.cpp:546)
    4.                         0x102ef1634 SerializeTraits<ArrayOfManagedObjectsTransferer>::ResizeSTLStyleArray(ArrayOfManagedObjectsTransferer&, int) + 168 (ManagedObject.h:168)
    5.                         0x10326ad30 void StreamedBinaryRead::TransferSTLStyleArray<ArrayOfManagedObjectsTransferer>(ArrayOfManagedObjectsTransferer&, TransferMetaFlags) + 123 (ScriptingTypes.h:123)
    6.                         0x103267460 void Transfer_ManagedObject<StreamedBinaryRead, true>(SerializationCommandArguments const&, RuntimeSerializationCommandInfo&) + 237 (ManagedObject.h:237)
    7.                         0x1032671ec void TransferField_LinearCollection<StreamedBinaryRead>(SerializationCommandArguments const&, RuntimeSerializationCommandInfo&) + 72 (InitializeTransferFunctionScriptingTraits.h:72)
    8.                         0x10326acb0 void ExecuteSerializationCommands<StreamedBinaryRead>(SerializationCommandProvider&, StreamedBinaryRead&, GeneralMonoObject const&) + 117 (SerializationCommands.h:117)
    9.                         0x10326449c void TransferScriptingObject<StreamedBinaryRead>(StreamedBinaryRead&, ScriptingObjectPtr, ScriptingClassPtr, SerializationCache::Data*&) + 568 (dynamic_array.h:568)
    10.                         0x1032939ac SerializedFile::ReadObject(long long, ObjectCreationMode, bool, TypeTree const**, bool*, Object&) + 2207 (SerializedFile.cpp:2207)
    11.                         0x10328a54c PersistentManager::ReadAndActivateObjectThreaded(int, SerializedObjectIdentifier const&, SerializedFile*, bool, bool, PersistentManager::LockFlags) + 2385 (PersistentManager.cpp:2385)
    12.                         0x10328ab8c PersistentManager::LoadFileCompletelyThreaded(core::basic_string<char, core::StringStorageDefault<char> > const&, long long*, int*, int, PersistentManager::LoadFlags, LoadProgress&, PersistentManager::LockFlags) + 1978 (PersistentManager.cpp:1978)
    13.                         0x10319d9e8 LoadSceneOperation::Perform() + 140 (LoadSceneOperation.cpp:140)
    14.                         0x10319f34c PreloadManager::ProcessSingleOperation() + 273 (PreloadManager.cpp:273)
    15.                         0x10319f0ec PreloadManager::Run() + 316 (PreloadManager.cpp:316)
    16.                         0x10319f0a0 PreloadManager::Run(void*) + 179 (PreloadManager.cpp:179)
    17.                         0x1031e061c Thread::RunThreadWrapper(void*) + 87 (Thread.cpp:87)
    18. libsystem_pthread.dylib 0x1c3429840 _pthread_start + 168
    19. libsystem_pthread.dylib 0x1c34319f4 thread_start + 8
     
    Last edited: Jan 15, 2020