我已经进行了广泛的搜索以找到解决此问题的方法,并尝试了过去所看到的建议。
我尝试过的事情: 本地删除的* .iml文件 本地删除的.idea文件 删除了项目 关闭Android Studio,然后重新导入
无效的缓存 清洗并重新建造。 我假设引起问题的原因是将MainActivity移到了新创建的包中。任何建议将不胜感激。
2019-02-23 17:04:15.948 5842-5842/com.ssowens.android.myweatherapp E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ssowens.android.myweatherapp, PID: 5842
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.ssowens.android.myweatherapp/com.ssowens.android.myweatherapp.ui.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.ssowens.android.myweatherapp.ui.MainActivity" on path: DexPathList[[zip file "/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/base.apk"],nativeLibraryDirectories=[/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/lib/x86, /system/lib, /vendor/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2718)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.ssowens.android.myweatherapp.ui.MainActivity" on path: DexPathList[[zip file "/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/base.apk"],nativeLibraryDirectories=[/data/app/com.ssowens.android.myweatherapp-UUO7m3VwjvpzPBPoUp-2AA==/lib/x86, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.Instrumentation.newActivity(Instrumentation.java:1173)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2708)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)