- Home /
Problems with Build an Run for Android in Unity 2021.1.0b5
Hello. I download Unity 2021.10b5, and I have problems with this version. I pressed Build and Run button for test my app, but appears 13 errors. I included screenshot for your information.
I have included all the list of errors appear in the Console:
1. Assertion failed on expression: 'ins.second || ins.first->second == artifactID || (ins.first->second == CircularDependencyArtifactID() && !artifactID.IsValid()) || GetPathFromAssetGuidV2(key.GetGUID()).ends_with(".cs")' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
2. File C:\Users\User.android\repositories.cfg could not be loaded. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
3 Assembly for Assembly Definition File 'Packages/com.unity.xiaomi/Xiaomi.asmdef' will not be compiled, because it has no scripts associated with it. UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
4 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') UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
5 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') UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
6. 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' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
7 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' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
8 Type '[Unity.TextMeshPro]TMPro.TextMeshPro' has an extra field '_SortingLayer' of type 'System.Int32' in the player and thus can't be serialized (expected 'm_hasFontAssetChanged' of type 'System.Boolean') UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
9 Type '[Unity.TextMeshPro]TMPro.TextMeshPro' has an extra field '_SortingLayerID' of type 'System.Int32' in the player and thus can't be serialized (expected 'm_hasFontAssetChanged' of type 'System.Boolean') UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
10 Type '[Unity.TextMeshPro]TMPro.TextMeshPro' has an extra field '_SortingOrder' of type 'System.Int32' in the player and thus can't be serialized (expected 'm_hasFontAssetChanged' of type 'System.Boolean') UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
11 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' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
12 Fields serialized in target platform, class 'TMPro.TextMeshPro' '_SortingLayer' of type 'System.Int32' '_SortingLayerID' of type 'System.Int32' '_SortingOrder' of type 'System.Int32' 'm_hasFontAssetChanged' of type 'System.Boolean' 'm_renderer' of type 'UnityEngine.Renderer' 'm_maskType' of type 'TMPro.MaskingTypes' UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
13 Error building player because script class layout is incompatible between the editor and the player.
14 Build completed with a result of 'Failed' in 208 seconds (208271 ms) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
15 UnityEditor.BuildPlayerWindow+BuildMethodException: 10 errors at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in :0 at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in :0 UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
Could you please help me? Thank you..
Answer by FVS · Mar 27, 2021 at 10:45 AM
did you solve it? and how?
Yes, the errors were fixed. It was updated Text Mesh Pro. Thanks you.
Let me explain to you, how I fixed the problem, I went to Window, Package Manager + Unity Registry + TextMeshPro (Update or Install), and that's helped me to resolve the problem.
Thank you. But I couldn't fix $$anonymous$$e. So I created a brand new project :D
Answer by theolagendijk · Jul 07, 2021 at 12:02 PM
I had the same issue in Unity Editor 2021.1.13f1 running on MacOS. My Unity project would run just fine in the Unity Editor. But would throw the above types of errors when building for Android or for iOS. For me this issue was resolved by;
1) closing the Unity editor. 2) Deleting the "obj" and the "Library" folder and then 3) reopening the project in the Unity Editor.
I hope this helps someone.
Where can I find these folders. I am a beginner can you help me please? I am having the same issue. (Edit: Never$$anonymous$$d I found them and it worked.)
Answer by realragnvaldr · Apr 29, 2021 at 09:35 PM
Same problem here after i switched to 2021.1.5f1 (no problems before). App runs without problems in the Unity Editor.
Then i try to build for android and i get 13 errors, like
Type '[Unity.TextMeshPro]TMPro.TextMeshPro' has an extra field '_SortingLayer' of type 'System.Int32' in the player and thus can't be serialized
After i re-import TextMeshPro via package manager, it gives 175 errors... Any solutions to this?
Answer by bpolaro · Jul 09, 2021 at 11:19 PM
I just re-imported all my assets and it built fine after the error.
Answer by omsrobert · Apr 07, 2021 at 03:29 PM
I am having the same problem. Unity QA is terrible. What a buggy development system!
Your answer
Follow this Question
Related Questions
Android APK Build Failing "Execution failed for task ':launcher:checkReleaseDuplicateClasses'." 5 Answers
Unable to list target platforms. When I try to build to Andriod on Mac 5 Answers
Android build fails for project with large array of data 1 Answer
Android build gradle failed 1 Answer
UnityEditor.BuildPlayerWindow+BuildMethodException - Anyone guide to solve this ERROR please??? 0 Answers