Zohaib
Zohaib

Reputation: 2865

BaseGame Util cannot be resolved to a type

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.

enter image description here enter image description here

Upvotes: 3

Views: 3988

Answers (3)

Bonasu
Bonasu

Reputation: 1

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.

Upvotes: 0

Uwais A
Uwais A

Reputation: 737

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

Upvotes: 4

Jorgesys
Jorgesys

Reputation: 126445

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

Upvotes: 2

Related Questions