Android change SDK version in Eclipse? Unable to resolve target android-x
Asked Answered
C

7

33

I developed an Android aplication against 2.1 SDK. Since then I have re-installed Eclipse/Android SDK; with the new install, I want to 'upgrade' the dependancy of the Android application to 2.2 SDK (because I dont want 2.1 installed on my machine). Is this possible? I am getting the following error from eclipse:

[2010-08-31 18:18:32 - AndroidApplication] Unable to resolve target 'android-7'
Chanel answered 1/9, 2010 at 0:22 Comment(0)
F
59

If you're using eclipse you can open default.properties file in your workspace and change the project target to the new sdk (target=android-8 for 2.2). I accidentally selected the 1.5 sdk for my version and didn't catch it until much later, but updating that and restarting eclipse seemed to have done the trick.

Feral answered 28/9, 2010 at 5:30 Comment(2)
I also had to change <uses-sdk android:minSdkVersion="..."/> in my AndroidManifest.xmlOxymoron
Also update file "project.properties" in project directory, it worked for me only after changing it.Ravelin
L
15

go to project properties and change the target from 7 to 8 also change the target in android manifest and also go to properties of project by right clicking on the project and choose the target

Louvar answered 30/1, 2012 at 6:56 Comment(1)
+1 if you don't want to change default properties, just the sdk version for one or two projects.Quetzalcoatl
B
7

This can happen when you mistakenly import an Android project into your Eclipse workspace as a Java project. The solution in this case: delete the project from the workspace in the Package Explorer, then go to File -> Import -> Android -> Existing Android code into workspace.

Barley answered 17/9, 2012 at 16:25 Comment(0)
T
5

I faced the same issue and got it working.

I think it is because when you import a project, build target is not set in the project properties which then default to the value used in manifest file. Most likely, you already have installed a later android API with your SDK.

The solution is to enable build target toward your installed API level (but keep the minimum api support as specified in the manifest file). TO do this, in project properties, go to android, and from "Project Build Target", pick a target name.

Triecious answered 6/1, 2013 at 23:24 Comment(0)
E
3

In Build: v22.6.2-1085508 ADT you need to add(select Android 4.4.2)

Goto project --> properties --> Android(This is second in listed item order leftPanel) and in the RightPanel Project Build Target, select Android 4.4.2 as Target name and apply changes It will rebuild the workspace.

In my case unable to resolve target 'android-17' eclipse was being shown as compile error and in code: import java.util.HashMap was not being referenced.

Ervinervine answered 17/5, 2014 at 14:51 Comment(0)
L
2

This Problem is because of Path so you need to build the path using following Steps

Goto project ----->Right Click on Project Name ---->properties ---->click on Than Java Build Path option than ---> click Android 4.2.2---->Ok

Lowell answered 18/1, 2014 at 11:20 Comment(0)
H
1

Goto project -->properties --> (in the dialog box that opens goto Java build path), and in order and export select android 4.1 (your new version) and select dependencies.

Hydride answered 13/7, 2012 at 17:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.