码迷,mamicode.com
首页 > 移动开发 > 详细

Android Unable to instantiate activity ComponentInfo

时间:2014-10-18 11:08:43      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   http   color   io   os   ar   java   

Android开发环境,真是脆弱....折腾人。

昨晚敲点书上的代码,今天来公司运行,就各种报错,如下:

10-18 10:03:56.063: W/dalvikvm(14661): Unable to resolve superclass of Lcom/example/geoquizfrist/QuizActivity; (761)
10-18 10:03:56.063: W/dalvikvm(14661): Link of class ‘Lcom/example/geoquizfrist/QuizActivity;‘ failed
10-18 10:03:56.073: D/AndroidRuntime(14661): Shutting down VM
10-18 10:03:56.073: W/dalvikvm(14661): threadid=1: thread exiting with uncaught exception (group=0x40ad0228)
10-18 10:03:56.073: E/AndroidRuntime(14661): FATAL EXCEPTION: main
10-18 10:03:56.073: E/AndroidRuntime(14661): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.geoquizfrist/com.example.geoquizfrist.QuizActivity}: java.lang.ClassNotFoundException: com.example.geoquizfrist.QuizActivity
10-18 10:03:56.073: E/AndroidRuntime(14661):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
10-18 10:03:56.073: E/AndroidRuntime(14661):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2229)
10-18 10:03:56.073: E/AndroidRuntime(14661):     at android.app.ActivityThread.access$600(ActivityThread.java:139)
10-18 10:03:56.073: E/AndroidRuntime(14661):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1261)
10-18 10:03:56.073: E/AndroidRuntime(14661):     at android.os.Handler.dispatchMessage(Handler.java:99)
10-18 10:03:56.073: E/AndroidRuntime(14661):     at android.os.Looper.loop(Looper.java:154)

QuizActivity这个类明明有,怎么都不行....

后来发现在,是build path的问题。如下图:

bubuko.com,布布扣

必须按上面的这样,要把Android Private Libraries勾上才可以。而且Android Private Libraries下面必须要有appcompat_v7下的libs,如果没有,CLEAN代码。

bubuko.com,布布扣

 

Android Unable to instantiate activity ComponentInfo

标签:android   style   blog   http   color   io   os   ar   java   

原文地址:http://www.cnblogs.com/elm5280/p/4032663.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!