본문 바로가기
Unity/Settings

유니티 구글 플레이 게임 서비스 연동 에러

by 노튜 2020. 4. 13.
728x90
반응형

1. 에러 로그

 

2. 발생 위치

PrefabImporterEditor.OnEnable must call base OnEnable to avoid unexpected behaviour

UnityEditor.AssetDatabase.Refresh()

GooglePlayGames.Editor.GPGSUpgrader:.cctor() (at Assets/GooglePlayGames/Editor/GPGUpgrader.cs:102)

UnityEditor.Editorassemblies:processInitializeOnLoadAttributes(Type[])

 

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.GameObjectInspector.ClearPreviewCache () (at <6f28216fea9f453abf2e05b770ed3ee4>:0)
UnityEditor.GameObjectInspector.OnDisable () (at <6f28216fea9f453abf2e05b770ed3ee4>:0)
UnityEditor.AssetDatabase:Refresh()
GooglePlayGames.Editor.GPGSUpgrader:.cctor() (at Assets/GooglePlayGames/Editor/GPGSUpgrader.cs:102)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[])

 

GPGSUpgrader.cs 파일의 AssetDataBase.Refresh(); 에서 발생하는 오류이다.

유니티에서 게임을 플레이 할 경우 발생한다.

스마트폰에서는 정상으로 작동하는 것으로 보인다.

3. 문제해결 

오류가 발생한 부분에 조건절을 추가해준다. 

GPGSUpgrader.cs 파일 오픈 후→ AssetDataBase.Refresh() 

if(!EditorApplication.isplayingOrWillChangePlaymode){
AssetDataBase.Refresh();
}

 

문제해결

 

 

 

References

[1] Antonz0 commented on 17 Jan 2018

https://github.com/playgameservices/play-games-plugin-for-unity/issues/2029

 

NullReferenceException in v0.9.42 w/ unity2017.2.0f3 · Issue #2029 · playgameservices/play-games-plugin-for-unity

First: tx for the great work. There seems to be a NullReferenceException when the plugin tries to call GPGSUpgrader.cs at line 114. Not sure what the cause is, so I just past the error here: NullRe...

github.com

 

 

728x90
반응형