我正在使用学习Android游戏编程这本书来学习动画,但我似乎无法解决问题。
我正在使用eclipse,我已经安装了sdk和平台4 8 10和15。
我从this图书网站下载了第2章。
当我运行它时,它崩溃了,我得到了下面的logcat。
请帮助,我已经坚持了一个多星期。
01-27 15:14:31.519: I/System.out(17507): Sending WAIT chunk
01-27 15:14:31.519: W/ActivityThread(17507): Application com.pearson.lagp.v3 is waiting for the debugger on port 8100...
01-27 15:14:32.149: I/dalvikvm(17507): Debugger is active
01-27 15:14:32.319: I/System.out(17507): Debugger has connected
01-27 15:14:32.319: I/System.out(17507): waiting for debugger to settle...
01-27 15:14:32.520: I/System.out(17507): waiting for debugger to settle...
01-27 15:14:32.720: I/System.out(17507): waiting for debugger to settle...
01-27 15:14:32.920: I/System.out(17507): waiting for debugger to settle...
01-27 15:14:33.130: I/System.out(17507): waiting for debugger to settle...
01-27 15:14:33.330: I/System.out(17507): waiting for debugger to settle...
01-27 15:14:33.531: I/System.out(17507): waiting for debugger to settle...
01-27 15:14:33.731: I/System.out(17507): waiting for debugger to settle...
01-27 15:14:33.931: I/System.out(17507): waiting for debugger to settle...
01-27 15:14:34.131: I/System.out(17507): debugger has settled (1324)
01-27 15:14:34.482: D/dalvikvm(17507): threadid=1: still suspended after undo (sc=1 dc=1)
01-27 15:15:12.048: D/AndroidRuntime(17507): Shutting down VM
01-27 15:15:12.048: W/dalvikvm(17507): threadid=1: thread exiting with uncaught exception (group=0x4001e578)
01-27 15:15:12.108: E/AndroidRuntime(17507): FATAL EXCEPTION: main
01-27 15:15:12.108: E/AndroidRuntime(17507): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.pearson.lagp.v3/com.pearson.lagp.v3.StartActivity}: java.lang.ClassNotFoundException: com.pearson.lagp.v3.StartActivity in loader dalvik.system.PathClassLoader[/data/app/com.pearson.lagp.v3-1.apk]
01-27 15:15:12.108: E/AndroidRuntime(17507): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1573)
01-27 15:15:12.108: E/AndroidRuntime(17507): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
01-27 15:15:12.108: E/AndroidRuntime(17507): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
01-27 15:15:12.108: E/AndroidRuntime(17507): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
01-27 15:15:12.108: E/AndroidRuntime(17507): at android.os.Handler.dispatchMessage(Handler.java:99)
01-27 15:15:12.108: E/AndroidRuntime(17507): at android.os.Looper.loop(Looper.java:130)
01-27 15:15:12.108: E/AndroidRuntime(17507): at android.app.ActivityThread.main(ActivityThread.java:3691)
01-27 15:15:12.108: E/AndroidRuntime(17507): at java.lang.reflect.Method.invokeNative(Native Method)
01-27 15:15:12.108: E/AndroidRuntime(17507): at java.lang.reflect.Method.invoke(Method.java:507)
01-27 15:15:12.108: E/AndroidRuntime(17507): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
01-27 15:15:12.108: E/AndroidRuntime(17507): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)
01-27 15:15:12.108: E/AndroidRuntime(17507): at dalvik.system.NativeStart.main(Native Method)
01-27 15:15:12.108: E/AndroidRuntime(17507): Caused by: java.lang.ClassNotFoundException: com.pearson.lagp.v3.StartActivity in loader dalvik.system.PathClassLoader[/data/app/com.pearson.lagp.v3-1.apk]
01-27 15:15:12.108: E/AndroidRuntime(17507): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
01-27 15:15:12.108: E/AndroidRuntime(17507): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
01-27 15:15:12.108: E/AndroidRuntime(17507): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
01-27 15:15:12.108: E/AndroidRuntime(17507): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
01-27 15:15:12.108: E/AndroidRuntime(17507): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1565)
01-27 15:15:12.108: E/AndroidRuntime(17507): ... 11 more
答案 0 :(得分:0)
它是classnotfoundexception
,我怀疑你在manifest.xml中拥有的包名与你为活动声明的包不同。