Unable to resolve target 'android-8' after importing libraries

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”.

  • 403:The request is understood, but it has been refused Twitter Android
  • Android file uploader with server-side php
  • Positioning OK/Cancel buttons so that they mimic the layout in dialogs
  • Android Image Dialog/Popup same size as image and no border
  • Android JellyBean not Recognizing getTextSize of AttriubteSet
  • Android: ClickableSpan in clickable TextView
  • 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.

    Related posts:

    Android set height and width of Custom view programmatically
    Android avd is off-screen
    Refreshing makers (ClusterItems) in Google Maps v2 for Android
    Print Pdf file via Bluetooth Printer Android
    onClick or onItemClick while paused results in “IllegalStateException: Can not perform thi...
    Flash in an Android WebView - layering issue
  • Theme Programmatically set. How to reload Activity to apply
  • Get Drawable resource from inside DefaultHandler
  • Android Test Driven Development
  • What does the syntax “final String… args” mean/do?
  • ViewPager with Google Maps API v2: mysterious black view
  • JQuery doesn't work on WebView
  • 2 Solutions collect form web for “Unable to resolve target 'android-8' after importing libraries”

    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 🙂

    in some cases after installation you should select the target platform for your project. to do so:

    1. Right click on project->properties.
    2. Select Android on left panel.
    3. If you see Android 4.0.3 in (Project Build Target), then tick it and click Apply button.
    4. If you don’t have 4.0.3 version in Build Targets, then you don’t have it yet. to install simply go to sdk manager and click on
      Android 4.0.3(API 15)-SDK Platform.
    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.