【发布时间】:2014-05-30 10:33:51
【问题描述】:
所以我刚刚设置了 Eclipse 以使用 Gradle 与 LibGDX 一起工作。安装后发现安卓包有问题,包旁边有个红叉。当我进一步打开它时,src 旁边有一个红十字,然后是 com.myname.game.android,然后是 AndroidLauncher.java。当我打开 AndroidLauncher.java 时,这是我得到的代码:
package com.faturbansloth.game.android;
import android.os.Bundle;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.faturbansloth.game.MyGame;
public class AndroidLauncher extends AndroidApplication {
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
initialize(new MyGame(), config);
}
}
当我查看 AndroidLauncher.java 代码中的错误时,他们说:
-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
我正在使用 SDK Manager 22.6.2 和最新的 Eclipse Gradle 插件。我有 JRE 8 和 JDK 7。有没有办法解决这个问题?提前致谢。
【问题讨论】:
-
谢谢,我搜索的时候没有注意到这个。
标签: java android eclipse gradle libgdx