libGDX ApplicationListener not found

三世轮回 提交于 2019-12-24 14:45:15

问题


Hey right now i'm making a 2D game, for the desktop and Android. I installed libGDX because i heard that it made developing a game in java easier. But when i run the desktop code it shows up with this error java: cannot access com.badlogic.gdx.ApplicationListener class file for com.badlogic.gdx.ApplicationListener not found This is the Main code that i'm running:

    package com.rare.Forms;

import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;




public class Main {
    public static void main(String[] args) {
        LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
        cfg.title = "MyGame";
        cfg.useGL20 = false;
        cfg.width = 480;
        cfg.height = 320;

        new LwjglApplication(new MyGame(), cfg);
    }
}

I've tried installing the library, multiple times but it always shows the same error. I would be very greatfull you someone could help me. Ohh and sorry for the bad english, it isn't my birth language.


回答1:


Edit: The original answer is no longer valid, as the linked tutorial does not exist anymore and LibGDX has changed quite a bit since then. There is now an official documentation on how to setup the environment. Note, that Android Studio or IntelliJ is recommended, as it is the only IDE to officially support Android.

I am posting it as an answer that you can mark it as solved and it can help others in future. If you are using Eclipse the setup in this tutorial should help you. If you are using intellij you can load the project in eclipse do this setup and then import it to intellij. I am sure that you can do the things also in intellij without eclipse but i don't know intellij so i can't help you with this.



来源:https://stackoverflow.com/questions/21524776/libgdx-applicationlistener-not-found

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!