Cocos2d-x Plugin-X The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

mHelper.beginUserInitiatedSignIn();

 위와같이 구글 플레이 로그인 처리 중 아래와 같은 이슈가 발생했습니다. 아직 Cocos2d-x의 Plugin-X에 적응하는 과정이고 구글 플레이 게임 서비스도 처음 연동하다보니 이슈가 많네요.


01-03 15:56:27.979: W/dalvikvm(18477): VFY: unable to resolve static field 139 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-03 15:56:27.979: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x003f
01-03 15:56:27.979: W/dalvikvm(18477): VFY: unable to resolve static field 139 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x004c
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 134 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0057
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 130 (common_google_play_services_enable_title) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0062
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 145 (common_google_play_services_update_title) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x006d
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 142 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x007f
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 138 (common_google_play_services_network_error_title) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0091
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 139 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x00a3
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 139 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x00b5
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 136 (common_google_play_services_invalid_account_title) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x00c7
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 139 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x00da
01-03 15:56:27.984: W/dalvikvm(18477): VFY: unable to resolve static field 142 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string;
01-03 15:56:27.984: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x00ed
01-03 15:56:27.989: W/dalvikvm(18477): VFY: unable to resolve static field 131 (common_google_play_services_install_button) in Lcom/google/android/gms/R$string;
01-03 15:56:27.989: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x000f
01-03 15:56:27.989: W/dalvikvm(18477): VFY: unable to resolve static field 128 (common_google_play_services_enable_button) in Lcom/google/android/gms/R$string;
01-03 15:56:27.989: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0016
01-03 15:56:27.989: W/dalvikvm(18477): VFY: unable to resolve static field 143 (common_google_play_services_update_button) in Lcom/google/android/gms/R$string;
01-03 15:56:27.989: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x001d
01-03 15:56:27.989: W/dalvikvm(18477): VFY: unable to resolve static field 139 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-03 15:56:27.989: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0007
01-03 15:56:27.989: W/dalvikvm(18477): VFY: unable to resolve static field 133 (common_google_play_services_install_text_tablet) in Lcom/google/android/gms/R$string;
01-03 15:56:27.989: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0018
01-03 15:56:27.994: W/dalvikvm(18477): VFY: unable to resolve static field 132 (common_google_play_services_install_text_phone) in Lcom/google/android/gms/R$string;
01-03 15:56:27.994: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0038
01-03 15:56:27.994: W/dalvikvm(18477): VFY: unable to resolve static field 129 (common_google_play_services_enable_text) in Lcom/google/android/gms/R$string;
01-03 15:56:27.994: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x003f
01-03 15:56:27.994: W/dalvikvm(18477): VFY: unable to resolve static field 144 (common_google_play_services_update_text) in Lcom/google/android/gms/R$string;
01-03 15:56:27.994: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0046
01-03 15:56:27.994: W/dalvikvm(18477): VFY: unable to resolve static field 141 (common_google_play_services_unsupported_text) in Lcom/google/android/gms/R$string;
01-03 15:56:27.994: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0066
01-03 15:56:27.994: W/dalvikvm(18477): VFY: unable to resolve static field 137 (common_google_play_services_network_error_text) in Lcom/google/android/gms/R$string;
01-03 15:56:27.994: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x006d
01-03 15:56:27.994: W/dalvikvm(18477): VFY: unable to resolve static field 135 (common_google_play_services_invalid_account_text) in Lcom/google/android/gms/R$string;
01-03 15:56:27.994: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x0074
01-03 15:56:27.994: W/dalvikvm(18477): VFY: unable to resolve static field 140 (common_google_play_services_unsupported_date_text) in Lcom/google/android/gms/R$string;
01-03 15:56:27.994: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x007b
01-03 15:56:27.999: W/dalvikvm(18477): VFY: unable to resolve static field 139 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-03 15:56:27.999: D/dalvikvm(18477): VFY: replacing opcode 0x60 at 0x000c
01-03 15:56:27.999: E/GooglePlayServicesUtil(18477): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.


VFY: unable to resolve static field 139 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string; 이건 BaseGameUtils 이슈와 비슷한 에러고 각종 유니티3D 플러그인 작업할 때도 역시나 비슷하게 해결을 했기 때문에 이것도 아래 그림과 같이 google-play-services_lib에 있는 res 폴더의 것들을 작업중인 플러그인 폴더의 ForRes 폴더에 복사해 줬습니다.



 ./publish.sh 를 실행해 플러그인을 게시 후 프로젝트에 적용하기 위해 XWin에서 ./gamedevguide.sh를 실행해서 최종 이클립스에 적용했습니다. 리플레쉬한 후 빌드하는데 AndroidManifest.xml에서 아래와 같은 에러가 발생했습니다.


Description Resource Path Location Type
error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name'). AndroidManifest.xml /plugintest line 7 Android AAPT Problem
error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name'). AndroidManifest.xml /plugintest line 9 Android AAPT Problem

 플러그인 프로젝트의 FroRes에 복사한 google-play-services_lib에 있는 res의 내용을 적용하는 중에 values/strings.xml이 덮어쓰기가 되는 바람에 내용이 날라가서 생긴 이슈였습니다.

<string name="app_name">plugintest</string>

 이 내용을 strings.xml에 추가하고 publish.sh와 gamedevguide.sh를 다시 실행해 적용했습니다. 이클립스 갱신, 빌드 및 실행 후 로그인 요청했더니

01-03 16:36:56.254: W/dalvikvm(21366): VFY: unable to resolve static field 245 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
01-03 16:36:56.254: D/dalvikvm(21366): VFY: replacing opcode 0x60 at 0x003f


 기존과는 field 숫자만 다른 에러만 또 쭉 발생하네요. 이 방식이 아닌가 봅니다. 그래서 아래와 같이 기존에 Java Build Path에 추가했던 google-play-services.jar는 Remove하고 아예 google-play-services_lib 라이브러리 프로젝트를 Android - Library에 추가해 의존성을 추가했습니다.




 그랬더니 당연하게도 res쪽에서 중복되는 것들이 있다고 아래와 같이 에러를 뿜더군요.

Description Resource Path Location Type
error: Attribute "adUnitId" has already been defined ads_attrs.xml /plugintest/res/values line 13 Android AAPT Problem
error: Attribute "adSize" has already been defined ads_attrs.xml /plugintest/res/values line 10 Android AAPT Problem
error: Attribute "zOrderOnTop" has already been defined maps_attrs.xml /plugintest/res/values line 24 Android AAPT Problem
error: Attribute "useViewLifecycle" has already been defined maps_attrs.xml /plugintest/res/values line 23 Android AAPT Problem
error: Attribute "uiTiltGestures" has already been defined maps_attrs.xml /plugintest/res/values line 20 Android AAPT Problem
error: Attribute "uiScrollGestures" has already been defined maps_attrs.xml /plugintest/res/values line 19 Android AAPT Problem
error: Attribute "uiZoomGestures" has already been defined maps_attrs.xml /plugintest/res/values line 22 Android AAPT Problem
error: Attribute "uiZoomControls" has already been defined maps_attrs.xml /plugintest/res/values line 21 Android AAPT Problem
error: Attribute "cameraZoom" has already been defined maps_attrs.xml /plugintest/res/values line 16 Android AAPT Problem
error: Attribute "cameraTilt" has already been defined maps_attrs.xml /plugintest/res/values line 15 Android AAPT Problem
error: Attribute "uiRotateGestures" has already been defined maps_attrs.xml /plugintest/res/values line 18 Android AAPT Problem
error: Attribute "uiCompass" has already been defined maps_attrs.xml /plugintest/res/values line 17 Android AAPT Problem
error: Attribute "cameraBearing" has already been defined maps_attrs.xml /plugintest/res/values line 12 Android AAPT Problem
error: Attribute "mapType" has already been defined maps_attrs.xml /plugintest/res/values line 5 Android AAPT Problem
error: Attribute "cameraTargetLng" has already been defined maps_attrs.xml /plugintest/res/values line 14 Android AAPT Problem
error: Attribute "cameraTargetLat" has already been defined maps_attrs.xml /plugintest/res/values line 13 Android AAPT Problem


 진행중인 게임 프로젝트의 res 폴더를 기본으로 싹 롤백하고 플러그인 프로젝트의 ForRes 폴더도 구글 플레이 서비스 app_id값이 있는 ids.xml 파일만 빼고 모두 삭제했습니다. 그리고 다시 publish.sh 및 gamedevguide.sh 를 실행 후 리플레시 및 빌드는 잘 되더군요. 실행을 했더니 아래와 같은 이슈가 발생했습니다.



[2014-01-03 16:55:52 - Dex Loader] Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;
[2014-01-03 16:55:52 - plugintest] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lcom/google/ads/AdRequest$ErrorCode;


 Multiple dex files define 이라는거 보니 뭔가 또 중복이구나 했는 역시나 Java Build Path에 Remove했던 google-play-services.jar가 그대로 있더군요. 이젠 프로젝트를 통으로 Lib로 포함해서 따로 jar는 필요 없는데 말이죠.



 원인은 게임 서비스 플러그인 프로젝트의 sdk 폴더에 넣어둔 google-play-services.jar 파일이 publish.sh와 gamedevguide.sh 를 하는 과정에서 자동으로 복사되고 적용되서 생긴거였습니다. 아직 Cocos2d-x 플러그인 시스템에 익숙치 않아서 이런 실수도 하네요. 작업중인 플러그인 프로젝트/sdk 폴더의 google-play-services.jar를 삭제하고 플러그인 프로젝트의 Java Build Path에는 sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs 의 google-play-services.jar를 추가 후 publish 하니 ant 빌드시 아래와 같이 오류가 발생하네요.


    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:12: error: cannot access GooglePlayServ
icesClient
    [javac] public class GameServiceUser implements GameHelperListener, Interfac
eUser {
    [javac]        ^
    [javac]   class file for com.google.android.gms.common.GooglePlayServicesCli
ent not found
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:37: error: cannot find symbol
    [javac]             GPGSWrapper.initGameService(mContext, this, GameHelper.C
LIENT_GAMES, bDebug);
    [javac]                                                   ^
    [javac]   symbol:   variable this
    [javac]   location: class GameServiceUser
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:32: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:40: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:46: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:52: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:58: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:64: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:70: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:76: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:82: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] D:\cocos2d-x-3.0alpha1\plugin\plugins\gameservices\proj.android\src\
org\cocos2dx\plugin\GameServiceUser.java:88: error: method does not override or
implement a method from a supertype
    [javac]     @Override
    [javac]     ^
    [javac] 12 errors


 그래서 플러그인 프로젝트의 Java Build Path에 추가한 sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs 의 google-play-services.jar를 삭제하고 google-play-services_lib 프로젝트를 Library로 아예 추가하니 전에 발생했던 build.xml을 찾는 오류가 발생하네요... 아... 멀고도 험한..일단 Library 프로젝트에서 삭제했습니다.



 그냥 다시 플러그인 프로젝트의 sdk 폴더에 google-play-services.jar를 넣어 publish.sh를 성공한 후 gamedevguide를 적용하기 전에 위 그림과 같이 plugin/publish 폴더안에 작업중인 구글 플레이 게임 서비스 플러그인 폴더에 복사된 google-play-services.jar를 삭제하고 gamedevguide.sh를 적용해줬습니다.


Description Resource Path Location Type
Project 'plugintest' is missing required library: 'plugin-x/plugins/gameservices/android/google-play-services.jar' plugintest Build path Build Path Problem

 이클립스로 돌아와 게임 프로젝트를 빌드하니 삭제한 플러그인 폴더의 google-play-services.jar 를 찾고 있는 오류가 발생하네요. 아래 그림과 같이 아직 Java Build Path에 정보가 남아있더군요. gamedevguide.sh가 기존에 있다가 삭제가 되면 .classpath 파일을 수정해줘야하는데 아직은 기능 미구현인듯 하네요.


 자바 빌드 패스에서 삭제 후 빌드 실행하면 이제 오류 로그는 발생안하네요.

01-03 18:07:45.555: D/GPGSWrapper(24790): GameHelper: Starting USER-INITIATED sign-in flow.

 단, 위 로그만 나오고 로그인 창이 나온다던지 액션이 없는게 문제입니다. 이 이슈는 다른 포스팅에서 정리해보겠습니다. 일단 이번 이슈를 정리하자면,
  • google-play-services.jar 는 플러그인 프로젝트의 sdk에 일단 복사해 놓고 publish까지는 일단 성공시킨 후 gamedevguide.sh를 실행 전에 publish 폴더에 복사 된 google-play-services.jar 는 삭제 한다. 이 삭제 작업은 gamedevguide.sh 실행이 필요할 때마다 반복하거나 안드로이드 게임 프로젝트 설정에서 삭제한다.
  • 구글 플레이 게임 서비스 SDK의 res 문제 이슈 해결을 위해 작업중인 게임 프로젝트에서 google-play-services_lib를 아예 프로젝트 통으로 Lib로 가져온다.

 유니티3D 안드로이드 플러그인 작업할 때도 느낀거지만 서드파티 SDK가 뭔가 res 폴더를 사용하면 그 res를 플러그인 폴더에 복사하거나 jar파일에 포함해서 익스포트해주거나 아니면 지금처럼 서드파티 SDK Lib 프로젝트를 아예 프로젝트 통으로 포함시켜줘야 하는 이슈가 있네요. Cocos2d-x나 유니티3D나 안드로이드라면...

댓글

이 블로그의 인기 게시물

'xxx.exe' 프로그램을 시작할 수 없습니다. 지정된 파일을 찾을 수 없습니다.

goorm IDE에서 node.js 프로젝트로 Hello World Simple Server 만들어 띄워보기

애드센스 수익을 웨스턴 유니온으로 수표대신 현금으로 지급 받아보자.