eclipse安装LibGDX后的bug [英] bugs in eclipse after installing LibGDX
问题描述
在Eclipse中:
- 打开Android SDK管理器:窗口 - > Android SDK管理器。
- 标记如果没有安装 SDK Plataform 适用于Android 4.4.2(API 19)并进行安装。
- 最后使用文件 - >导入 - >常规 - >现有项目导入项目进入工作区。
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
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:
- In Libgdx Project Generator open Advanced options.
- Check Eclipse.
- Generate your project.
In Eclipse:
- Open Android SDK Manager: Window -> Android SDK Manager.
- Mark if it isn't installed the SDK Plataform for Android 4.4.2 (API 19) and install it.
- Finally import the projects with File -> Import -> General -> Existing Projects into Workspace.
这篇关于eclipse安装LibGDX后的bug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!