user3165683
user3165683

Reputation: 367

The import com.badlogic cannot be resolved in Java Project Libgdx Setup

I've just tried to setup Libgdx to start making games, i followed this tutorial https://www.youtube.com/watch?v=S9fs1PVTyUc&feature=youtu.be in conjunction with the libgdx grdale setup. However an error shows up in the Java project which says:

The import com.badlogic cannot be resolved

I am using Eclipse for Java IDE. I believe I have the Android SDK installed. I think it may be to do with the setup but i think the latest updates are there and i tried deleting '.m2'ccahe, which is not there any more btw after i deleted it (not been replaced), but this didnt work. Any ideas?

heres my code for the java proect:

import com.badlogic.gmx.Game;

public class GameMain extends Game{

}//'com.badlogic 'gets an error and so does 'Game'

enter image description here

Upvotes: 2

Views: 6289

Answers (1)

Jyro117
Jyro117

Reputation: 4529

The issue you are encountering is your eclipse project "CreateGame" is not setup correctly. It is missing the files needed to use libgdx.

Possible Solutions:

Also make sure your game code is going into the game-core project as this project is used by each platform you are targeting.

Upvotes: 3

Related Questions