Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libGDX IntelliJ IDEA cannot access com.badlogic.gdx.Application

I have created a project with libGDX setup ui. The project works great in Eclipse but when I imported it in Android Studio, the android project MainActivity.java throws 4 exceptions:

java: cannot access com.badlogic.gdx.Application
class file for com.badlogic.gdx.Application not found

java: cannot find symbol
symbol:   variable super
location: class com.vestrel00.nekko.MainActivity

java: cannot find symbol
symbol:   method initialize(com.vestrel00.nekko.KFNekko,com.badlogic.gdx.backends.android.AndroidApplicationConfiguration)
location: class com.vestrel00.nekko.MainActivity

java: method does not override or implement a method from a supertype

Does anyone have a solution?

like image 360
Irakli Lekishvili Avatar asked Dec 07 '13 00:12

Irakli Lekishvili


1 Answers

So I've fixed my problem: I just added libGdx.jar files to my desktop and android projects.

Solution:

Right click on the project > Open Module Settings > Libraries > Small green button (New Project Library Alt+Insert) > Java > and then select libGdx.jar file. After that, you must include this library into your desktop and android projects.

Don't Close the window, select Modules > android > Dependencies > Small Green button > Module Dependency and select main project. Do the same for desktop and press Ok.

Thats all. All my projects work correctly now.

Here's a tutorial with images. It is explained how to run desktop project too.

http://imgur.com/a/IBFIV

like image 55
Irakli Lekishvili Avatar answered Nov 06 '22 21:11

Irakli Lekishvili