问题描述
- 安卓-导入项目-编译时报错
-
这是log:
07-20 20:00:00.490: E/AndroidRuntime(1641): FATAL EXCEPTION: main
07-20 20:00:00.490: E/AndroidRuntime(1641): Process: com.cyl.online, PID: 1641
07-20 20:00:00.490: E/AndroidRuntime(1641): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.cyl.online/com.cyl.online.activity.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.cyl.online.activity.MainActivity" on path: DexPathList[[zip file "/data/app/com.cyl.online-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.cyl.online-2, /system/lib]]
07-20 20:00:00.490: E/AndroidRuntime(1641): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
07-20 20:00:00.490: E/AndroidRuntime(1641): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
07-20 20:00:00.490: E/AndroidRuntime(1641): at android.app.ActivityThread.access$800(ActivityThread.java:135)
07-20 20:00:00.490: E/AndroidRuntime(1641): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
07-20 20:00:00.490: E/AndroidRuntime(1641): at android.os.Handler.dispatchMessage(Handler.java:102)
07-20 20:00:00.490: E/AndroidRuntime(1641): at android.os.Looper.loop(Looper.java:136)
07-20 20:00:00.490: E/AndroidRuntime(1641): at android.app.ActivityThread.main(ActivityThread.java:5001)
07-20 20:00:00.490: E/AndroidRuntime(1641): at java.lang.reflect.Method.invokeNative(Native Method)
07-20 20:00:00.490: E/AndroidRuntime(1641): at java.lang.reflect.Method.invoke(Method.java:515)
07-20 20:00:00.490: E/AndroidRuntime(1641): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
07-20 20:00:00.490: E/AndroidRuntime(1641): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
07-20 20:00:00.490: E/AndroidRuntime(1641): at dalvik.system.NativeStart.main(Native Method)
07-20 20:00:00.490: E/AndroidRuntime(1641): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.cyl.online.activity.MainActivity" on path: DexPathList[[zip file "/data/app/com.cyl.online-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.cyl.online-2, /system/lib]]
07-20 20:00:00.490: E/AndroidRuntime(1641): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
07-20 20:00:00.490: E/AndroidRuntime(1641): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
07-20 20:00:00.490: E/AndroidRuntime(1641): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
07-20 20:00:00.490: E/AndroidRuntime(1641): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
07-20 20:00:00.490: E/AndroidRuntime(1641): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
07-20 20:00:00.490: E/AndroidRuntime(1641): ... 11 more
07-20 20:00:04.090: I/Process(1641): Sending signal. PID: 1641 SIG: 9期间各种办法都试过,重新导包,clean工程 重新编译,调整jar包先后顺序,这个项目在别人的eclipse上就能运行,到我机器上就不行了 ,就是提示类找不着,这个activity在配置文件中也已经注册过了,真心着急啊,求各位大牛指导,感激不尽!!
解决方案
1、看看是不是android版本不对
2、看看是不是引用了其他项目的包
解决方案二:
版本没错 也没有引用其他项目的包 我感觉像是sdk的问题
解决方案三:
别急再看看那错了 着急就容易粗心,有可能是你忽略了什么地方
解决方案四:
你是说项目直接引入他人的电脑中就能运行???,但是你的电脑就不行?肯定是电脑的环境配置有差别造成
时间: 2024-11-03 20:27:55