我在Eclipse中遇到了一个奇怪的Maven问题。我试图为我的项目添加一些依赖,但我失败了。为了解决这个问题,我右键单击了项目并在下拉菜单中选择了Maven-> Update项目。之后,每当我尝试运行它时,我的项目都会崩溃。我在LogCat中有以下错误:
FATAL EXCEPTION: main
Process: com.my.synch, PID: 16267
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.my.synch/synch.ui.activities.concreteactivities.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "synch.ui.activities.concreteactivities.MainActivity" on path: DexPathList[[zip file "/data/app/com.my.synch-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.my.synch-1, /vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2163)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2286)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:212)
at android.app.ActivityThread.main(ActivityThread.java:5135)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:878)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "synch.ui.activities.concreteactivities.MainActivity" on path: DexPathList[[zip file "/data/app/com.my.synch-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.my.synch-1, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2154)
... 11 more
为什么会这样?
答案 0 :(得分:0)
您是否在此类未指定的异常错误上指定的路径上有您的类MainActivity?
java.lang.ClassNotFoundException:未找到类“synch.ui.activities.concreteactivities.MainActivity”
这个错误是maven找不到这个类。