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

I created a project with the libGDX ui setup. The project works fine in Eclipse, but when I imported it into 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 

Anyone have a solution?

+6
source share
1 answer

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

Decision:

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

Do not close the window, select "Modules"> "Android"> "Dependencies"> "Small green button"> "Module dependency" and select the main project. Do the same for the desktop and click OK.

That's all. All my projects work correctly.

Here is a tutorial with images. It also explains how to run a working project on the desktop.

http://imgur.com/a/IBFIV

+11
source

Source: https://habr.com/ru/post/959507/


All Articles