问题
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
> inLibrary
section check if your library is correct and don´t show any red cross.Check the same for your
BaseGameUtils
library, probably the reference togoogle_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