So I imported an existing project to eclipse and I have a lot of trouble making it work. The project came with three other library projects:
google_play_services-lib
CaptureActivity
PortraitQR
As soon as I imported the project, I went under 'Java Build Path' and added paths for needed jars:
After I successfully added the needed jars, I went on to the libraries. I imported all three needed libraries (that I was given along with the project) and it all went well:
After that I also made sure private libraries are checked under the export tab:
After I was done importing the project I tried to run it but it crashed instantly. This is the logcat file:
07-17 17:33:36.543: E/AndroidRuntime(25965): FATAL EXCEPTION: main
07-17 17:33:36.543: E/AndroidRuntime(25965): 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-1.apk
07-17 17:33:36.543: E/AndroidRuntime(25965): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
07-17 17:33:36.543: E/AndroidRuntime(25965): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-17 17:33:36.543: E/AndroidRuntime(25965): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-17 17:33:36.543: E/AndroidRuntime(25965): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-17 17:33:36.543: E/AndroidRuntime(25965): at android.os.Handler.dispatchMessage(Handler.java:99)
07-17 17:33:36.543: E/AndroidRuntime(25965): at android.os.Looper.loop(Looper.java:137)
07-17 17:33:36.543: E/AndroidRuntime(25965): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-17 17:33:36.543: E/AndroidRuntime(25965): at java.lang.reflect.Method.invokeNative(Native Method)
07-17 17:33:36.543: E/AndroidRuntime(25965): at java.lang.reflect.Method.invoke(Method.java:511)
07-17 17:33:36.543: E/AndroidRuntime(25965): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-17 17:33:36.543: E/AndroidRuntime(25965): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-17 17:33:36.543: E/AndroidRuntime(25965): at dalvik.system.NativeStart.main(Native Method)
07-17 17:33:36.543: E/AndroidRuntime(25965): Caused by: java.lang.ClassNotFoundException: Didn't find class "si.dvanadva.evanturist.MainActivity" on path: /data/app/si.dvanadva.evanturist-1.apk
07-17 17:33:36.543: E/AndroidRuntime(25965): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
07-17 17:33:36.543: E/AndroidRuntime(25965): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-17 17:33:36.543: E/AndroidRuntime(25965): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-17 17:33:36.543: E/AndroidRuntime(25965): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
07-17 17:33:36.543: E/AndroidRuntime(25965): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
07-17 17:33:36.543: E/AndroidRuntime(25965): ... 11 more
I can see from the logcat file that the problem is 'finding MainActivity class'
Solutions that I have tried so far:
Checked if MainActivity is correctly declared in the AndroidManifest file (it is)
Checked private libraries under the export tab
Deleted bin folder and cleaned project
I also tried declaring activities in the AndroidManifest file by not including the package name, like this: android:name=".activityname"
Deleted the previous version of the app from my phone and tried compiling again
Checked for si.dvanadva.evanturist-1.apk in workspace project but I can't find it (am I missing it?)
Did this to set JAVA_HOME but it doesn't work
Started a new android application project and copied files in there
Maybe I also tried something else but I forgot to mention it, I've been working on this for quite a while now and I'm running out of things to try. I'll greatly appreciate any kind of help!