报错:java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.d

时间:2021-11-02 20:52:25

刚重新安装了Studio  运行了以前的项目,明明能运行的啊 ! 怎么回突然间报错呢?

稍加一看,唉 真是.....太尴尬了

报错如下:

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.demo2/com.example.demo2.v.activity.BaseActivity$MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.example.demo2.v.activity.BaseActivity$MainActivity" on path: DexPathList[[zip file "/data/app/com.example.demo2-1/base.apk", zip file "/data/app/com.example.demo2-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.demo2-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.demo2-1/lib/x86, /vendor/lib, /system/lib]]
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2236)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
        at android.app.ActivityThread.access$800(ActivityThread.java:151)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:135)
        at android.app.ActivityThread.main(ActivityThread.java:5254)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
解决方法:
manifest 里仔细查看 ,
会有爆红的地方,
注册的Activity 路径错了 稍加改正即可