So I've been struggling with importing an existing project to eclipse for a few days now and I've finally figured it out. I imported all the needed library projects and it works fine, but there's one more error.
Library project 'PortraitQR' has a red 'x' mark next to it says 'Unable to resolve target 'android-8''.
I tried to compile the application anyway but it crashes, here's the logcat file:
07-16 18:24:14.296: E/AndroidRuntime(9673): FATAL EXCEPTION: main
07-16 18:24:14.296: E/AndroidRuntime(9673): 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:24:14.296: E/AndroidRuntime(9673): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2106)
07-16 18:24:14.296: E/AndroidRuntime(9673): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
07-16 18:24:14.296: E/AndroidRuntime(9673): at android.app.ActivityThread.access$600(ActivityThread.java:141)
07-16 18:24:14.296: E/AndroidRuntime(9673): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
07-16 18:24:14.296: E/AndroidRuntime(9673): at android.os.Handler.dispatchMessage(Handler.java:99)
07-16 18:24:14.296: E/AndroidRuntime(9673): at android.os.Looper.loop(Looper.java:137)
07-16 18:24:14.296: E/AndroidRuntime(9673): at android.app.ActivityThread.main(ActivityThread.java:5041)
07-16 18:24:14.296: E/AndroidRuntime(9673): at java.lang.reflect.Method.invokeNative(Native Method)
07-16 18:24:14.296: E/AndroidRuntime(9673): at java.lang.reflect.Method.invoke(Method.java:511)
07-16 18:24:14.296: E/AndroidRuntime(9673): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
07-16 18:24:14.296: E/AndroidRuntime(9673): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
07-16 18:24:14.296: E/AndroidRuntime(9673): at dalvik.system.NativeStart.main(Native Method)
07-16 18:24:14.296: E/AndroidRuntime(9673): 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:24:14.296: E/AndroidRuntime(9673): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
07-16 18:24:14.296: E/AndroidRuntime(9673): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
07-16 18:24:14.296: E/AndroidRuntime(9673): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
07-16 18:24:14.296: E/AndroidRuntime(9673): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
07-16 18:24:14.296: E/AndroidRuntime(9673): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
07-16 18:24:14.296: E/AndroidRuntime(9673): ... 11 more
I did some research on how to fix android-8 resolve target error, but I can't find anywhere what to do if the error shows as soon as you import libraries. People usually have this error when updating with SDK manager.
I had to open up SDK manager and simply installed API level 8. That solved my problem. Vote up the user in the comments that gave me the solution :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With