java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{

今天更改android工程的包名,程序没有报错,运行在adt上显示

12-01 15:19:20.391: W/dalvikvm(5228): threadid=1: thread exiting with uncaught exception (group=0xb4c87908)
12-01 15:19:20.391: E/AndroidRuntime(5228): FATAL EXCEPTION: main
12-01 15:19:20.391: E/AndroidRuntime(5228): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.qqq21/com.example.qqq21.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.qqq21.MainActivity" on path: /data/app/com.example.qqq21-1.apk
12-01 15:19:20.391: E/AndroidRuntime(5228): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
12-01 15:19:20.391: E/AndroidRuntime(5228): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
12-01 15:19:20.391: E/AndroidRuntime(5228): at android.app.ActivityThread.access$600(ActivityThread.java:141)
12-01 15:19:20.391: E/AndroidRuntime(5228): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
12-01 15:19:20.391: E/AndroidRuntime(5228): at android.os.Handler.dispatchMessage(Handler.java:99)
12-01 15:19:20.391: E/AndroidRuntime(5228): at android.os.Looper.loop(Looper.java:137)
12-01 15:19:20.391: E/AndroidRuntime(5228): at android.app.ActivityThread.main(ActivityThread.java:5041)
12-01 15:19:20.391: E/AndroidRuntime(5228): at java.lang.reflect.Method.invokeNative(Native Method)
12-01 15:19:20.391: E/AndroidRuntime(5228): at java.lang.reflect.Method.invoke(Method.java:511)
12-01 15:19:20.391: E/AndroidRuntime(5228): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
12-01 15:19:20.391: E/AndroidRuntime(5228): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
12-01 15:19:20.391: E/AndroidRuntime(5228): at dalvik.system.NativeStart.main(Native Method)
12-01 15:19:20.391: E/AndroidRuntime(5228): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.example.qqq21.MainActivity" on path: /data/app/com.example.qqq21-1.apk
12-01 15:19:20.391: E/AndroidRuntime(5228): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
12-01 15:19:20.391: E/AndroidRuntime(5228): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
12-01 15:19:20.391: E/AndroidRuntime(5228): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
12-01 15:19:20.391: E/AndroidRuntime(5228): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
12-01 15:19:20.391: E/AndroidRuntime(5228): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)


后经调查AndroidManifest.xml文件中

                    android:name=".MainActivity"     //后来改为“com.example.qqq.MainActivity”
            android:label="@string/app_name" >   
           
               
               
           

       

然后就好使了



你可能感兴趣的:(android,exception,android)