Solucionado (ver solução)
Solucionado
(ver solução)
7
respostas

Problema no build

Tão dando vários erros na hora de fazer o build, como: Type '[Unity.TextMeshPro]TMPro.TextMeshPro' has an extra field 'SortingLayer' of type 'System.Int32' in the player and thus can't be serialized (expected 'mhasFontAssetChanged' of type 'System.Boolean') UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

7 respostas

Oi, Isabela, aparecem outros erros ou só esse?

Type '[Unity.TextMeshPro]TMPro.TextMeshPro' has an extra field 'SortingLayer' of type 'System.Int32' in the player and thus can't be serialized (expected 'mhasFontAssetChanged' of type 'System.Boolean') UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Type '[Unity.TextMeshPro]TMPro.TextMeshPro' has an extra field 'SortingLayerID' of type 'System.Int32' in the player and thus can't be serialized (expected 'mhasFontAssetChanged' of type 'System.Boolean') UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Type '[Unity.TextMeshPro]TMPro.TextMeshPro' has an extra field 'SortingOrder' of type 'System.Int32' in the player and thus can't be serialized (expected 'mhasFontAssetChanged' of type 'System.Boolean') UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Fields serialized in Editor, class 'TMPro.TextMeshPro' 'm_hasFontAssetChanged' of type 'System.Boolean' 'm_renderer' of type 'UnityEngine.Renderer' 'm_maskType' of type 'TMPro.MaskingTypes' 'SortingLayer' of type 'System.Int32' 'SortingLayerID' of type 'System.Int32' '_SortingOrder' of type 'System.Int32'

UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Fields serialized in target platform, class 'TMPro.TextMeshPro' 'SortingLayer' of type 'System.Int32' 'SortingLayerID' of type 'System.Int32' 'SortingOrder' of type 'System.Int32' 'mhasFontAssetChanged' of type 'System.Boolean' 'm_renderer' of type 'UnityEngine.Renderer' 'm_maskType' of type 'TMPro.MaskingTypes'

UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Type '[UnityEngine.UI]UnityEngine.UI.InputField' has an extra field 'm_OnEndEdit' of type 'UnityEngine.UI.InputField+EndEditEvent' in the player and thus can't be serialized (expected 'm_OnValueChanged' of type 'UnityEngine.UI.InputField+OnChangeEvent') UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Type '[UnityEngine.UI]UnityEngine.UI.InputField' has an extra field 'm_OnSubmit' of type 'UnityEngine.UI.InputField+SubmitEvent' in the player and thus can't be serialized (expected 'm_OnValueChanged' of type 'UnityEngine.UI.InputField+OnChangeEvent') UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Fields serialized in Editor, class 'UnityEngine.UI.InputField' 'm_TextComponent' of type 'UnityEngine.UI.Text' 'm_Placeholder' of type 'UnityEngine.UI.Graphic' 'm_ContentType' of type 'UnityEngine.UI.InputField+ContentType' 'm_InputType' of type 'UnityEngine.UI.InputField+InputType' 'm_AsteriskChar' of type 'System.Char' 'm_KeyboardType' of type 'UnityEngine.TouchScreenKeyboardType' 'm_LineType' of type 'UnityEngine.UI.InputField+LineType' 'm_HideMobileInput' of type 'System.Boolean' 'm_CharacterValidation' of type 'UnityEngine.UI.InputField+CharacterValidation' 'm_CharacterLimit' of type 'System.Int32' 'm_OnEndEdit' of type 'UnityEngine.UI.InputField+SubmitEvent' 'm_OnValueChanged' of type 'UnityEngine.UI.InputField+OnChangeEvent' 'm_CaretColor' of type 'UnityEngine.Color' 'm_CustomCaretColor' of type 'System.Boolean' 'm_SelectionColor' of type 'UnityEngine.Color' 'm_Text' of type 'System.String' 'm_CaretBlinkRate' of type 'System.Single' 'm_CaretWidth' of type 'System.Int32' 'm_ReadOnly' of type 'System.Boolean' 'm_ShouldActivateOnSelect' of type 'System.Boolean'

UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Fields serialized in target platform, class 'UnityEngine.UI.InputField' 'm_TextComponent' of type 'UnityEngine.UI.Text' 'm_Placeholder' of type 'UnityEngine.UI.Graphic' 'm_ContentType' of type 'UnityEngine.UI.InputField+ContentType' 'm_InputType' of type 'UnityEngine.UI.InputField+InputType' 'm_AsteriskChar' of type 'System.Char' 'm_KeyboardType' of type 'UnityEngine.TouchScreenKeyboardType' 'm_LineType' of type 'UnityEngine.UI.InputField+LineType' 'm_HideMobileInput' of type 'System.Boolean' 'm_CharacterValidation' of type 'UnityEngine.UI.InputField+CharacterValidation' 'm_CharacterLimit' of type 'System.Int32' 'm_OnEndEdit' of type 'UnityEngine.UI.InputField+EndEditEvent' 'm_OnSubmit' of type 'UnityEngine.UI.InputField+SubmitEvent' 'm_OnValueChanged' of type 'UnityEngine.UI.InputField+OnChangeEvent' 'm_CaretColor' of type 'UnityEngine.Color' 'm_CustomCaretColor' of type 'System.Boolean' 'm_SelectionColor' of type 'UnityEngine.Color' 'm_Text' of type 'System.String' 'm_CaretBlinkRate' of type 'System.Single' 'm_CaretWidth' of type 'System.Int32' 'm_ReadOnly' of type 'System.Boolean' 'm_ShouldActivateOnSelect' of type 'System.Boolean'

UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Tem esses também: Error building player because script class layout is incompatible between the editor and the player.

Build completed with a result of 'Failed' in 2 seconds (1514 ms) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:123)

UnityEditor.BuildPlayerWindow+BuildMethodException: 10 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002be] in /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:190 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:95 UnityEditor.BuildPlayerWindow:BuildPlayerAndRun () (at /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindow.cs:123)

solução!

Qual o caminho da pasta do C: até o projeto?

/Users/bebelicha/Documents/Alura/Unity1/zumbi

Oi, Isabela, tudo bem?

Alguns passos simples podem resolver o problema:

  • Tenta tirar esse número da pasta
  • Deletar os caches da pasta de Library e tentar novamente
  • Ir no arquivo emscripten que fica na pasta C:\Program Files\Unity\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\emscripten.config e tenta mudar dentro do arquivo na parte de NODE_JS o stack_size para algum número menor como 1024.

Se isso não resolver depois de fazer o build você pode navegar até Window > General > Console e clicar em Open Editor Log, cola esse log aqui que vamos analisando o que está dando errado durante o build :)

Limpei o cache e funcionou, muito obrigada! :D