运行Android应用程序时出现错误 [英] Error coming while running android application

查看:177
本文介绍了运行Android应用程序时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建使用eclipse的Android应用程序,但应用程序未对AVD运行它说:不幸的是已停止工作"

I have created an android application using eclipse but application is not running on AVD it is saying "Unfortunately has stopped working"

日志猫消息在下面给出 -

Log cat message is given below -

07-29 04:59:50.789: W/dalvikvm(784): threadid=1: thread exiting with uncaught exception (group=0x414c4700)
07-29 04:59:50.808: E/AndroidRuntime(784): FATAL EXCEPTION: main
07-29 04:59:50.808: E/AndroidRuntime(784): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.androidlove/com.example.androidlove.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.androidlove.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.androidlove-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.androidlove-1, /system/lib]]
07-29 04:59:50.808: E/AndroidRuntime(784):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2137)
07-29 04:59:50.808: E/AndroidRuntime(784):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
07-29 04:59:50.808: E/AndroidRuntime(784):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-29 04:59:50.808: E/AndroidRuntime(784):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
07-29 04:59:50.808: E/AndroidRuntime(784):  at android.os.Handler.dispatchMessage(Handler.java:99)
07-29 04:59:50.808: E/AndroidRuntime(784):  at android.os.Looper.loop(Looper.java:137)
07-29 04:59:50.808: E/AndroidRuntime(784):  at android.app.ActivityThread.main(ActivityThread.java:5103)
07-29 04:59:50.808: E/AndroidRuntime(784):  at java.lang.reflect.Method.invokeNative(Native Method)
07-29 04:59:50.808: E/AndroidRuntime(784):  at java.lang.reflect.Method.invoke(Method.java:525)
07-29 04:59:50.808: E/AndroidRuntime(784):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
07-29 04:59:50.808: E/AndroidRuntime(784):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
07-29 04:59:50.808: E/AndroidRuntime(784):  at dalvik.system.NativeStart.main(Native Method)
07-29 04:59:50.808: E/AndroidRuntime(784): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.androidlove.MainActivity" on path: DexPathList[[zip file "/data/app/com.example.androidlove-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.androidlove-1, /system/lib]]
07-29 04:59:50.808: E/AndroidRuntime(784):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
07-29 04:59:50.808: E/AndroidRuntime(784):  at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-29 04:59:50.808: E/AndroidRuntime(784):  at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-29 04:59:50.808: E/AndroidRuntime(784):  at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
07-29 04:59:50.808: E/AndroidRuntime(784):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
07-29 04:59:50.808: E/AndroidRuntime(784):  ... 11 more
07-29 04:59:58.399: I/Process(784): Sending signal. PID: 784 SIG: 9

请帮助我,我已经厌倦了解决此错误的事情.....

Please help me i am tired of solving this error.....

推荐答案

我面临同样的问题,我发现了示例代码被放置在JAVA"的文件夹,而不是SRC"文件夹.将代码移至src后,问题得以解决.

I faced the same problem and I found the sample code was put in the "JAVA" folder instead of the "src" folder. After moving the code to src, the problem was solved.

我希望那行得通.

这篇关于运行Android应用程序时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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