我首先实现系统和引擎多人游戏,然后能够调整所有导入和库并在MOTODEV
中运行而没有任何错误,但模拟器“已意外停止”。
您可以看到code here。
模拟器出错:
08-02 00:52:55.500: D/AndroidRuntime(330): Shutting down VM
08-02 00:52:55.500: W/dalvikvm(330): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
08-02 00:52:55.549: E/AndroidRuntime(330): FATAL EXCEPTION: main
08-02 00:52:55.549: E/AndroidRuntime(330): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.multiplayerand/com.multiplayerand.MainActivity}: java.lang.ClassNotFoundException: com.multiplayerand.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.multiplayerand-2.apk]
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.os.Looper.loop(Looper.java:123)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.main(ActivityThread.java:4627)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.reflect.Method.invokeNative(Native Method)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.reflect.Method.invoke(Method.java:521)
08-02 00:52:55.549: E/AndroidRuntime(330): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-02 00:52:55.549: E/AndroidRuntime(330): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-02 00:52:55.549: E/AndroidRuntime(330): at dalvik.system.NativeStart.main(Native Method)
08-02 00:52:55.549: E/AndroidRuntime(330): Caused by: java.lang.ClassNotFoundException: com.multiplayerand.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.multiplayerand-2.apk]
08-02 00:52:55.549: E/AndroidRuntime(330): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
08-02 00:52:55.549: E/AndroidRuntime(330): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
08-02 00:52:55.549: E/AndroidRuntime(330): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
08-02 00:52:55.549: E/AndroidRuntime(330): ... 11 more
答案 0 :(得分:1)
请注意日志中的这一行:
Unable to instantiate activity ComponentInfo{com.multiplayerand/com.multiplayerand.MainActivity}: java.lang.ClassNotFoundException: com.multiplayerand.MainActivity in loader dalvik.system.PathClassLoader
该行说明,您尝试instantiate activity
它的名称为MainActivity
且它位于com.multiplayerand
pakage,但系统找不到任何包含此Component-info的Activity,并且所以java.lang。ClassNotFoundException
已经发生了。
我想如果你能解决问题:
MainActivity
。 MainActivity
是否在名称为com.multiplayerand
的包裹中。 manifest
中注册了MainActivity。