我无法构建Google提供的示例游戏TypeANumberChallenge(请参见GitHub)。收到以下错误消息:



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


我确实包含了项目库BaseGameUtils和google-play-services-lib,如readmeGoogle Play Services Guides所述,但是仍然出现错误,并且不能仅仅进行编译...

更新:
我尝试删除TypeANumberChallenge并重做整个过程,并在尝试将BaseGameUtils添加为库时遇到了一个新错误:

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

最佳答案

通过阅读Google Play Services Guides解决了问题


  
  复制Google Play服务库项目。将库项目复制到
  <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/
  到您维护Android应用项目的位置。如果你
  使用Eclipse,将库项目导入到您的工作区中。
  单击文件>导入,选择Android>现有Android代码到
  工作区,然后浏览到库项目的副本以将其导入。
  


您不能直接使用SDK文件夹中的lib项目...
真是笑话..

10-07 19:14
查看更多