-1

I've imported an existing project to eclipse and all the needed libraries and there aren't any errors right now. But when I try to compile the app it still crashes as soon as it's supposed to run on android device. This is the logcat file:

07-16 18:49:13.187: E/AndroidRuntime(12183): FATAL EXCEPTION: main
07-16 18:49:13.187: E/AndroidRuntime(12183): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{si.dvanadva.evanturist/si.dvanadva.evanturist.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "si.dvanadva.evanturist.MainActivity" on path: /data/app/si.dvanadva.evanturist-2.apk
07-16 18:49:13.187: E/AndroidRuntime(12183):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at android.os.Handler.dispatchMessage(Handler.java:99)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at android.os.Looper.loop(Looper.java:137)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at android.app.ActivityThread.main(ActivityThread.java:5041)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at java.lang.reflect.Method.invokeNative(Native Method)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at java.lang.reflect.Method.invoke(Method.java:511)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at dalvik.system.NativeStart.main(Native Method)
07-16 18:49:13.187: E/AndroidRuntime(12183): Caused by: java.lang.ClassNotFoundException: Didn't find class "si.dvanadva.evanturist.MainActivity" on path: /data/app/si.dvanadva.evanturist-2.apk
07-16 18:49:13.187: E/AndroidRuntime(12183):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
07-16 18:49:13.187: E/AndroidRuntime(12183):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
07-16 18:49:13.187: E/AndroidRuntime(12183):    ... 11 more
07-16 18:49:27.664: E/fb4a(:<default>):MmsConfig(12350): MmsConfig.loadMmsSettings mms_config.xml missing uaProfUrl setting

Could anyone help me how to fix this problem?

Guy
  • 6,414
  • 19
  • 66
  • 136
  • Package the `si.dvanadva.evanturist.MainActivity` class? – Dave Newton Jul 16 '13 at 18:48
  • Just scan the logcat for "causedby" and you will see the exact problem `Caused by: java.lang.ClassNotFoundException: Didn't find class "si.dvanadva.evanturist.MainActivity" on path: /data/app/si.dvanadva.evanturist-2.apk` – Nick Jul 16 '13 at 19:24
  • @DaveNewton sorry for the delayed reply, but what exactly do you mean? – Guy Jul 16 '13 at 23:32

2 Answers2

0

You've added the libraries to Eclipse but likely not to your deployed APK. The libraries should be placed in your libs folder (or assets, depending on what version Android).

In other words, you might have your jars in some folder on your project workspace in Eclipse and told Eclipse that it's there. But when you deploy your APK, it's not going to ask Eclipse "where do I find the libraries?" It will look in the specified folders (libs, assets) for them.

dispake
  • 3,259
  • 2
  • 19
  • 22
  • Where should I put all my jars, library projects then? Can I just put everything in libs in my workspace or is there something else I should do? – Guy Jul 16 '13 at 19:07
0

Java Build Path in project properties, Order and Export tab, make all checkboxes checked ( private libraries etc...

Eugene Pinchuk
  • 546
  • 3
  • 14