Java (LibGDX Android)无法实例化活动组件信息ClassNotFoundException

Java (LibGDX Android)无法实例化活动组件信息ClassNotFoundException,java,android,eclipse,libgdx,classnotfoundexception,Java,Android,Eclipse,Libgdx,Classnotfoundexception,我已经在Eclipse中导入了由gdx安装程序创建的项目。没有错误,但当我尝试在手机或模拟器中启动应用程序时,应用程序崩溃,我的Logcat中有以下消息: 以下是我在android类中的代码: import android.os.Bundle; import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplicationConfig

我已经在Eclipse中导入了由gdx安装程序创建的项目。没有错误,但当我尝试在手机或模拟器中启动应用程序时,应用程序崩溃,我的Logcat中有以下消息: 以下是我在android类中的代码:

import android.os.Bundle;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.mygdx.game.MyGdxGame;

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

我知道这是一个常见的问题,但我尝试了很多解决方案,但都没有效果。 对不起,英语不好


感谢您的帮助。

由于AndroidLauncher中的Android初学者类的默认名称,我假设您已将其重命名为AndroidGame,并且代码中的一些重要部分未更新:

/android/build.gradle:

寻找这样的线条:
命令行“$adb”、'shell'、'am'、'start'、'-n'、'de.tomgrill.someandroidpackage.android/de.tomgrill.android.AndroidLauncher'

/前面的部分必须与AndroidManifest.xml中的包名匹配

就我而言:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="de.tomgrill.someandroidpackage.android"
......

由于Android starter类在AndroidLauncher中的默认名称,我假设您将其重命名为AndroidGame以及代码中未更新的一些重要部分:

/android/build.gradle:

寻找这样的线条:
命令行“$adb”、'shell'、'am'、'start'、'-n'、'de.tomgrill.someandroidpackage.android/de.tomgrill.android.AndroidLauncher'

/前面的部分必须与AndroidManifest.xml中的包名匹配

就我而言:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="de.tomgrill.someandroidpackage.android"
......