使用引导类加载器找不到类 [英] Class not found using the boot class loader

查看:182
本文介绍了使用引导类加载器找不到类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对此有一些疑问,但是我无法获得他们的任何解决方案.我尝试过的所有方法都失败了,有人知道我在做什么错吗?

there are a few questions out there about this, however I cannot get any of their solutions to work. Everything I've tried has failed, does anyone know what I'm doing wrong?

这是错误:

07-09 12:05:20.772 17337-17337/com.spaceshooter.game E/AndroidRuntime: FATAL EXCEPTION: main
                                                                       Process: com.spaceshooter.game, PID: 17337
                                                                       java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.spaceshooter.game/com.spaceshooter.game.AndroidLauncher}: java.lang.ClassNotFoundException: Didn't find class "com.spaceshooter.game.AndroidLauncher" on path: DexPathList[[zip file "/data/app/com.spaceshooter.game-2/base.apk"],nativeLibraryDirectories=[/data/app/com.spaceshooter.game-2/lib/arm, /data/app/com.spaceshooter.game-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3093)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
                                                                           at android.app.ActivityThread.access$1100(ActivityThread.java:221)
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                           at android.os.Looper.loop(Looper.java:158)
                                                                           at android.app.ActivityThread.main(ActivityThread.java:7225)
                                                                           at java.lang.reflect.Method.invoke(Native Method)
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
                                                                        Caused by: java.lang.ClassNotFoundException: Didn't find class "com.spaceshooter.game.AndroidLauncher" on path: DexPathList[[zip file "/data/app/com.spaceshooter.game-2/base.apk"],nativeLibraryDirectories=[/data/app/com.spaceshooter.game-2/lib/arm, /data/app/com.spaceshooter.game-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
                                                                           at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
                                                                           at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
                                                                           at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
                                                                           at android.app.Instrumentation.newActivity(Instrumentation.java:1095)
                                                                           at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3083)
                                                                           at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349) 
                                                                           at android.app.ActivityThread.access$1100(ActivityThread.java:221) 
                                                                           at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 
                                                                           at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                           at android.os.Looper.loop(Looper.java:158) 
                                                                           at android.app.ActivityThread.main(ActivityThread.java:7225) 
                                                                           at java.lang.reflect.Method.invoke(Native Method) 
                                                                           at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) 
                                                                           at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) 
                                                                        Suppressed: java.lang.ClassNotFoundException: com.spaceshooter.game.AndroidLauncher
                                                                           at java.lang.Class.classForName(Native Method)
                                                                           at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
                                                                           at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
                                                                           at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                                                                                ... 12 more
                                                                        Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

这是我的android启动器类:

Here is my android launcher class:

package com.spaceshooter.game;

import android.os.Bundle;

import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
import com.spencergang.game.SSGame;

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

以下是屏幕截图:

推荐答案

我在Android平板电脑上卸载了该应用程序,然后清理了该项目.现在我解决了问题 使用引导类加载器找不到类;没有可用的堆栈跟踪" 就像你一样.

I uninstall The application on the Android pad,then clean the project.and now I solve the problem "Class not found using the boot class loader; no stack trace available" just like you.

这篇关于使用引导类加载器找不到类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆