BaseGame Util cannot be resolved to a type

廉价感情. 提交于 2020-01-03 19:01:30

问题


my project requires BaseGameUtil library I have BaseGameUtil library downloaded form here

But when i import it in my android project it doesnt show baseGameUtil instead it shows main as added in my eclipse project and even when i add that main library i still get the same error.

Can anyone help me.


回答1:


BaseGameActivity cannot be resolved to a type

public Class FisrstActivity extends BaseGameActivity{
  • In your project, right click > properties > Android > in Library section check if your library is correct and don´t show any red cross.

  • Check the same for your BaseGameUtils library, probably the reference to google_play_services is incorrect.

you problem must be similar to : android - import - with developers google com games




回答2:


I think you may be using the version of BaseGameUtils in here:

...\android-samples-master\BasicSamples\libraries

But you are using Eclipse so you need to use the one in the following location:

...\android-samples-master\eclipse_compat\libraries

You may then also encounter an error with the GameHelper.java class in the BaseGameUtils folders. Use the code available here instead: https://gist.github.com/EmmanuelVinas/ef09a35bcc805ba6deb3




回答3:


Basegameutils from github includes all source .java files in java folder. When implementing in eclipse, move all these folders from 'java' to 'src'. Eclipse compiles them to produce .class files which fixes this problem.



来源:https://stackoverflow.com/questions/21791228/basegame-util-cannot-be-resolved-to-a-type

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