Unity Google Play Games Services 연동 오류로 인한 삽질 기록

3줄 요약

1. Unity - Google Play Games Services 연동 오류 발생(Unity 2018.2.1f1, GPGS Plugin for Unity 0.9.50)

2. 구글링해보니 AndroidManifest.xml 파일 자동 생성시 공백이 잘못들어감

3. 생성할때 사용하는 템플릿 파일(template-AndroidManifest.txt)을 수정하고 다시 해보니 정상 동작!


삽질 & 구글링


나름 튜토리얼을 보면서 잘 따라 했것만...
Google Play Console 의 출시관리>사전 출시 보고서에 비정상 종료 로그가 뜨고, APK 파일을 받아서 깔아보아도 제대로 실행이 안되었다.

오류 로그는 아래와 같음


사전출시 보고서 오류 리포트

문제: at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source:275)
FATAL EXCEPTION: main
Process: com.m2kestudio.unity.clicker, PID: 12207
java.lang.IllegalStateException: A fatal developer error has occurred. Check the logs for further information.
at com.google.android.gms.common.internal.zze.zzv(Unknown Source:78)
at com.google.android.gms.common.internal.zzi.zzakg(Unknown Source:54)
at com.google.android.gms.common.internal.zzh.handleMessage(Unknown Source:275)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

원인을 찾아 구글링을 하면서 삽질을 하다가 같은 문제를 해결한 글을 찾게 되었다.

Crash after “Application ID ( 232323232323) must be a numeric value.”

Logcat 로그 파일을 받아서 확인해보니 나역시 동일한 문제였다... (앞으로 상세로그를 잘 분석해봐야겠다...)

E/ValidateServiceOp(10480): Application ID ( 123456789012) must be a numeric value. Please verify that your manifest refers to the correct project ID.
(앱아이디는 임의로 수정 123456789012)


원인은 깃허브에서 받은 Google Play Games plugin for Unity 에서 자동으로 생성하는
AndroidManifest.xml 파일에 공백이 잘못들어가는 것이였음... 허탈...ㅋㅋㅋㅋ

해결

\Assets\GooglePlayGames\Editor\ 경로의
template-AndroidManifest.txt 파일의 다음 부분을 아래 처럼 수정

        <!-- The space in these forces it to be interpreted as a string vs. int -->
        <meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="\u003__APP_ID__" />

        <!-- Keep track of which plugin is being used -->
        <meta-data android:name="com.google.android.gms.games.unityVersion"
            android:value="\u003__PLUGIN_VERSION__" />


그리고 다시 유니티에서 Window>Google Play Games > Setup > Android setup...

메뉴로 들어가서 다시 셋업버튼을 누르면 AndroidManifest.xml 파일이 재생성 된다

수정전
        <!-- The space in these forces it to be interpreted as a string vs. int -->
        <meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="\ 123456789012" />

        <!-- Keep track of which plugin is being used -->
        <meta-data android:name="com.google.android.gms.games.unityVersion"
            android:value="\ 0.9.50" />


수정후
        <!-- The space in these forces it to be interpreted as a string vs. int -->
        <meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="\u003123456789012" />

        <!-- Keep track of which plugin is being used -->
        <meta-data android:name="com.google.android.gms.games.unityVersion"
            android:value="\u0030.9.50" />




이후 앱을 다시 빌드하고 정상 실행됨을 확인!

교훈

에러 로그를 상세하게 파악하자!

댓글

이 블로그의 인기 게시물

Aseprite 스프라이트 슬라이스해서 개별로 저장 하는방법 ( How to save sprite split in Aseprite )

Unity3D 에서 당신의 Pixel Art 게임을 Pixel Perfect 하게 만들기