bugs in eclipse after installing LibGDX

ぐ巨炮叔叔 提交于 2019-12-24 08:39:08

问题


i had no project in eclipse, and i just followed the steps in this toturial: https://www.youtube.com/watch?v=S9fs1PVTyUc&src_vid=6i78aqugqds&feature=iv&annotation_id=annotation_4141831685

and it opened for me a few projects named: project, project-android, project-core, project-desktop, project-ios.

and the project-android had an error. here is the code:

package com.ak01.projext.android;*

import android.os.Bundle;**

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.ak01.projext.Projec;

public class AndroidLauncher extends AndroidApplication {***
    @Override
    protected void onCreate (Bundle savedInstanceState) {****
        super.onCreate(savedInstanceState);
        AndroidApplicationConfiguration config = new 
        AndroidApplicationConfiguration();
        initialize(new Project(), config);
    }
}

but it has a few errors although i didn't touch it yet(the number of *'s matches to the line)

*The type android.os.Handler cannot be resolved. It is indirectly referenced from required .class files

**The import android.os.Bundle cannot be resolved

***Multiple markers at this line

-The type android.app.Activity cannot be resolved. It is indirectly referenced from required .class files

-The hierarchy of the type AndroidLauncher is inconsistent

****Bundle cannot be resolved to a type


回答1:


It looks like you have not installed the Android developer tools. To test this, right click your project and press build path. On the side there should be an 'Android' tab, if there isn't you need the android plugin for eclipse.




回答2:


You can try to use the advanced option to check eclipse as @Tuss said in a comment. Also note that you need the version 19 of Android SDK (it isn't valid the last version at the time of writing this, API 23).

When creating the Libgdx project:

  1. In Libgdx Project Generator open Advanced options.
  2. Check Eclipse.
  3. Generate your project.

In Eclipse:

  1. Open Android SDK Manager: Window -> Android SDK Manager.
  2. Mark if it isn't installed the SDK Plataform for Android 4.4.2 (API 19) and install it.
  3. Finally import the projects with File -> Import -> General -> Existing Projects into Workspace.


来源:https://stackoverflow.com/questions/28283193/bugs-in-eclipse-after-installing-libgdx

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