Eclipse中没有找到源代码

时间:2012-08-11 21:19:19

标签: android eclipse

我正在用Eclipse构建一个Android应用程序,直到我添加了一个特定的KeyEvent代码,一切顺利。一旦我试图模仿我的应用程序,它就崩溃了并且死了。我试图多次清理它,但它没有得到解决。此外,当我尝试编辑源路径时,源会显示一瞬间但消失。以下是未找到的来源:

ActivityThread.performLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2159    
ActivityThread.handleLaunchActivity(ActivityThread$ActivityClientRecord, Intent) line: 2189 
ActivityThread.access$600(ActivityThread, ActivityThread$ActivityClientRecord, Intent) line: 139    
ActivityThread$H.handleMessage(Message) line: 1261  
ActivityThread.main(String[]) line: 4894    
ZygoteInit$MethodAndArgsCaller.run() line: 784  
ZygoteInit.main(String[]) line: 551 
NativeStart.main(String[]) line: not available [native method]  

如何让它们变得可以使用?我非常接近我的应用程序准备好了。这是我的应用程序中唯一的挫折。

编辑:这是logcat输出:

08-12 10:52:02.359: E/AndroidRuntime(23219): FATAL EXCEPTION: main
08-12 10:52:02.359: E/AndroidRuntime(23219): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mshaw.avanos/com.mshaw.avanos.AvanosActivity}:       java.lang.NullPointerException
08-12 10:52:02.359: E/AndroidRuntime(23219):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2075)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2189)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at android.app.ActivityThread.access$600(ActivityThread.java:139)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at  android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at android.os.Handler.dispatchMessage(Handler.java:99)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at android.os.Looper.loop(Looper.java:154)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at android.app.ActivityThread.main(ActivityThread.java:4894)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at java.lang.reflect.Method.invokeNative(Native Method)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at java.lang.reflect.Method.invoke(Method.java:511)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at dalvik.system.NativeStart.main(Native Method)
08-12 10:52:02.359: E/AndroidRuntime(23219): Caused by: java.lang.NullPointerException
08-12 10:52:02.359: E/AndroidRuntime(23219):    at com.mshaw.avanos.SimpleEula.getPackageInfo(SimpleEula.java:25)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at com.mshaw.avanos.SimpleEula.show(SimpleEula.java:33)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at com.mshaw.avanos.AvanosActivity.<init>(AvanosActivity.java:36)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at java.lang.Class.newInstanceImpl(Native Method)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at java.lang.Class.newInstance(Class.java:1319)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at android.app.Instrumentation.newActivity(Instrumentation.java:1039)
08-12 10:52:02.359: E/AndroidRuntime(23219):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2066)
08-12 10:52:02.359: E/AndroidRuntime(23219):    ... 11 more

1 个答案:

答案 0 :(得分:0)

请按照以下步骤进行操作 1)转到调试视图
2)在Breakpoint选项卡下,您将看到NullPointerException
3)右键单击并取消选中捕获 4)再次调试项目

希望这会对你有所帮助。感谢