Google Player Game Service Error: Can't build the sample game

人盡茶涼 提交于 2019-12-11 01:55:30

问题


I can't build the sample game TypeANumberChallenge provided by Google (see GitHub). Got the following error message:

The project was not built since its build path is incomplete. Cannot find the class file for com.google.android.gms.games.GamesClient. Fix the build path then try building this project

The type com.google.android.gms.games.GamesClient cannot be resolved. It is indirectly referenced from required .class files    MainActivity.java   /TypeANumber/src/com/kerrywei/games/tanc

I did include the project library BaseGameUtils and google-play-services-lib as described by readme and Google Play Services Guides, but still got the error, and can't just compile...

Update: I tried to remove TypeANumberChallenge and redo the whole process and got a new error when trying to add BaseGameUtils as library:

An internal error occurred during: "Android Library Update".
Path must include project and resource name: /BaseGameUtils

回答1:


Problem solved by reading Google Play Services Guides

  1. Make a copy of the Google Play services library project. Copy the library project at <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ to the location where you maintain your Android app projects. If you are using Eclipse, import the library project into your workspace. Click File > Import, select Android > Existing Android Code into Workspace, and browse to the copy of the library project to import it.

You CANNOT use the lib project in SDK folder DIRECTLY... What a joke..



来源:https://stackoverflow.com/questions/17731591/google-player-game-service-error-cant-build-the-sample-game

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!