Google Play Game Services BaseGameUtils Build Error
구글 플레이 게임 서비스 연동을 위해 구글에서 지원하는 래퍼 유틸 클래스인 BaseGameUtils를 그냥 빌드하면 아래와 같은 에러와 로그를 볼 수 있습니다.
AppStateClient cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 701 Java Problem
PlusClient cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 696 Java Problem
GamesClient cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 691 Java Problem
GamesActivityResultCodes cannot be resolved to a variable GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 530 Java Problem
ConnectionResult cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 588 Java Problem
GooglePlayServicesUtil cannot be resolved GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 633 Java Problem
The method getGamesClient() from the type GameHelper refers to the missing type GamesClient BaseGameActivity.java /BaseGameUtils/src/com/google/example/games/basegameutils line 128 Java Problem
The hierarchy of the type BaseGameActivity is inconsistent BaseGameActivity.java /BaseGameUtils/src/com/google/example/games/basegameutils line 45 Java Problem
The import com.google.android cannot be resolved GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 36 Java Problem
The import com.google.android cannot be resolved BaseGameActivity.java /BaseGameUtils/src/com/google/example/games/basegameutils line 25 Java Problem
GooglePlayServicesClient cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 46 Java Problem
Scopes cannot be resolved to a variable GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 241 Java Problem
Scopes cannot be resolved to a variable GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 244 Java Problem
Scopes cannot be resolved to a variable GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 247 Java Problem
The method getAppStateClient() from the type GameHelper refers to the missing type AppStateClient BaseGameActivity.java /BaseGameUtils/src/com/google/example/games/basegameutils line 132 Java Problem
Invitation cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 812 Java Problem
The method onConnected(Bundle) of type GameHelper must override or implement a supertype method GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 801 Java Problem
The method onDisconnected() of type GameHelper must override or implement a supertype method GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 928 Java Problem
안드로이드 SDK 메니저를 통해 Google Play services 설치했다면 Java Build Path에서 sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs 폴더에 있는 google-play-services.jar 파일을 추가해줍니다.
그리고 이 프로젝트는 기본적으로 유틸클래스이므로 Is Library를 체크해서 라이브러리 프로젝트로 만들어 사용합니다. 기본적으로 체크 해제되어 있네요.
AppStateClient cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 701 Java Problem
PlusClient cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 696 Java Problem
GamesClient cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 691 Java Problem
GamesActivityResultCodes cannot be resolved to a variable GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 530 Java Problem
ConnectionResult cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 588 Java Problem
GooglePlayServicesUtil cannot be resolved GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 633 Java Problem
The method getGamesClient() from the type GameHelper refers to the missing type GamesClient BaseGameActivity.java /BaseGameUtils/src/com/google/example/games/basegameutils line 128 Java Problem
The hierarchy of the type BaseGameActivity is inconsistent BaseGameActivity.java /BaseGameUtils/src/com/google/example/games/basegameutils line 45 Java Problem
The import com.google.android cannot be resolved GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 36 Java Problem
The import com.google.android cannot be resolved BaseGameActivity.java /BaseGameUtils/src/com/google/example/games/basegameutils line 25 Java Problem
GooglePlayServicesClient cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 46 Java Problem
Scopes cannot be resolved to a variable GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 241 Java Problem
Scopes cannot be resolved to a variable GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 244 Java Problem
Scopes cannot be resolved to a variable GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 247 Java Problem
The method getAppStateClient() from the type GameHelper refers to the missing type AppStateClient BaseGameActivity.java /BaseGameUtils/src/com/google/example/games/basegameutils line 132 Java Problem
Invitation cannot be resolved to a type GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 812 Java Problem
The method onConnected(Bundle) of type GameHelper must override or implement a supertype method GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 801 Java Problem
The method onDisconnected() of type GameHelper must override or implement a supertype method GameHelper.java /BaseGameUtils/src/com/google/example/games/basegameutils line 928 Java Problem
안드로이드 SDK 메니저를 통해 Google Play services 설치했다면 Java Build Path에서 sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs 폴더에 있는 google-play-services.jar 파일을 추가해줍니다.
그리고 이 프로젝트는 기본적으로 유틸클래스이므로 Is Library를 체크해서 라이브러리 프로젝트로 만들어 사용합니다. 기본적으로 체크 해제되어 있네요.
댓글
댓글 쓰기