본문 바로가기

game dev/unity

웹 빌드 이슈사항 해결

웹 빌드를 하려고 할 때 총 2가지의 이슈 사항이 생겼다. 

 

1. color 에러

project Settings > player > Other settings - Color Space를 Linear > Gamma로 변경해줘서 해결.

 

 

 2. PUN의 직렬화 에러가 발생했다.

* 에러문은 가장 하단에 첨부

 

먼저 에러 문구를 보고 문제 파악. 

해당 파일의 직렬화 오류 난 클래스의 해당 부분을 찾고

아래 사진 1 > 사진2와 같이 직렬화 하지 않도록 처리 해주었다. 해결.

 

 

 

 

에러문

---

1. 
Type '[Assembly-CSharp]Photon.Chat.Demo.ChatGui' has an extra field 'chatAppSettings' of type 'Photon.Chat.ChatAppSettings' in the player and thus can't be serialized  (expected 'missingAppIdErrorPanel' of type 'UnityEngine.GameObject')
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
2. 
Fields serialized in Editor, class 'Photon.Chat.Demo.ChatGui'
    'ChannelsToJoinOnConnect' of type 'System.String[]'
    'FriendsList' of type 'System.String[]'
    'HistoryLengthToFetch' of type 'System.Int32'
    'missingAppIdErrorPanel' of type 'UnityEngine.GameObject'
    'ConnectingLabel' of type 'UnityEngine.GameObject'
    'ChatPanel' of type 'UnityEngine.RectTransform'
    'UserIdFormPanel' of type 'UnityEngine.GameObject'
    'InputFieldChat' of type 'UnityEngine.UI.InputField'
    'CurrentChannelText' of type 'UnityEngine.UI.Text'
    'ChannelToggleToInstantiate' of type 'UnityEngine.UI.Toggle'
    'FriendListUiItemtoInstantiate' of type 'UnityEngine.GameObject'
    'ShowState' of type 'System.Boolean'
    'Title' of type 'UnityEngine.GameObject'
    'StateText' of type 'UnityEngine.UI.Text'
    'UserIdText' of type 'UnityEngine.UI.Text'
    'TestLength' of type 'System.Int32'

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
3.
Fields serialized in target platform, class 'Photon.Chat.Demo.ChatGui'
    'ChannelsToJoinOnConnect' of type 'System.String[]'
    'FriendsList' of type 'System.String[]'
    'HistoryLengthToFetch' of type 'System.Int32'
    'chatAppSettings' of type 'Photon.Chat.ChatAppSettings'
    'missingAppIdErrorPanel' of type 'UnityEngine.GameObject'
    'ConnectingLabel' of type 'UnityEngine.GameObject'
    'ChatPanel' of type 'UnityEngine.RectTransform'
    'UserIdFormPanel' of type 'UnityEngine.GameObject'
    'InputFieldChat' of type 'UnityEngine.UI.InputField'
    'CurrentChannelText' of type 'UnityEngine.UI.Text'
    'ChannelToggleToInstantiate' of type 'UnityEngine.UI.Toggle'
    'FriendListUiItemtoInstantiate' of type 'UnityEngine.GameObject'
    'ShowState' of type 'System.Boolean'
    'Title' of type 'UnityEngine.GameObject'
    'StateText' of type 'UnityEngine.UI.Text'
    'UserIdText' of type 'UnityEngine.UI.Text'
    'TestLength' of type 'System.Int32'

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
4.
Error building player because script class layout is incompatible between the editor and the player.
5.
Build completed with a result of 'Failed' in 2 seconds (2208 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
6.
UnityEditor.BuildPlayerWindow+BuildMethodException: 4 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002da] in <780782bc035845f9909cebbd4c983ae3>:0 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <780782bc035845f9909cebbd4c983ae3>:0 
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

'game dev > unity' 카테고리의 다른 글

PUN chatgpt QnA  (0) 2024.07.30
이벤트시스템+UI 인터렉션 원리  (0) 2024.06.17
레이아웃 컴포넌트  (0) 2024.06.17
UGUI 반응형 만들기  (0) 2024.06.15
애니메이션  (0) 2024.06.15