• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps New Project - An SDK Target must be specified

techlover

Lurker
Oct 15, 2009
1
0
Hi Folks,
I'm sorry if you've heard this one before - I've had a look through the forums and can't find any solution that works.

So I try to create a new project and I get the above error in the New Android Project window. I've tried setting the SDK location preference in Window / Preferences / Android and it points to the folder that contains the \tools directory. Now I'm stuck. Can anyone offer any help? Much appreciated if you can.
Cheers,
Andy
 
Hi Folks,
I'm sorry if you've heard this one before - I've had a look through the forums and can't find any solution that works.

So I try to create a new project and I get the above error in the New Android Project window. I've tried setting the SDK location preference in Window / Preferences / Android and it points to the folder that contains the \tools directory. Now I'm stuck. Can anyone offer any help? Much appreciated if you can.
Cheers,
Andy

Check if you have the directories like "android <sdk target>" in <sdk-home>/platforms .
<sdk target> can be 1.1, 1.5, 1.6 or something like that.
I have them but eclipse still cant find them while creating a new project project. The " build target" field is still empty.

Help needed.

Thanks in advance.
 
Upvote 0
Damn!!!!

Check out how to build the "hello android" tutorial in Hello, World | Android Developers

When we create a new project in eclipse , all the fields are required . I filled up all the fields with the appropriate values and the error vanished. I read on that same page that target is automatically selected. You dont have do anything extra.

It should have been mentioned somewhere.
 
Upvote 0
I had the same problem, and hunted all over until I had a brainwave.
I moved the eclipse form up until half of it was off-screen, then dragged the bottom edge of the frame, to extend it. I could then see there were more options to complete, and a selection list, that didn't show up before.

I'm using Eclipse on Linux by the way...

Jim
 
Upvote 0
Hello all,

I think I am getting a similar error. Im sure im doing something really silly but i had added the location of the sdk to the preferences and i get no targets.

Please see the screen shot attached.

I am using - Eclipse SDK Version: 3.5.1, windows Vista and Android sdk r3

I hope you can help :)
 

Attachments

  • error.jpg
    error.jpg
    128.6 KB · Views: 465
Upvote 0
Two thumbnails below. The new project, is from my eclipse setup.

File > New > Project

This should display a window where you can select what kind of project to create. open the android folder, and select android project. You should also see an android test project option as well. After selecting Android project and hitting OK, you should receive the new android project dialogue. Thats the screen shot below new-android-project. Its a very tall screen as a previous poster mentioned.

In the middle of that screen shot is the build target selection. You need to specify what target your building against by checking one of the boxes.


The second screen shot is the Project properties window, which you can get to by right clicking on the main project folder (in the package explorer) and selecting properties. The screen shot depicts the properties dialog from the SDK's ApiDemos project. Notice it has an android entry on the left which I've selected. In there is the Build target for the project. This can be changed at any time so you can re-target against other api levels.

If you import or create a base Java project and forget to tell it, it's an Android project ... You can right click on the project folder in the package explorer and select:

Android Tools > Convert to Android Project

After that you might need to right click again, and this time:

Android Tools > Fix Project Properties

You will then need to specify what build target your project will build against.


If Window > Preferences > Android, doesn't show build targets with your SDK location provided ... you'll need to fix that before anything else will work.
 

Attachments

  • new-android-project.jpg
    new-android-project.jpg
    8.9 KB · Views: 470
  • existing-project-properties.jpg
    existing-project-properties.jpg
    17.8 KB · Views: 418
Upvote 0
I had the same problem and that's the solution. I 'm at 800x600 and when changing to 1024x768 the target option shows up :D
I had the same problem, and hunted all over until I had a brainwave.
I moved the eclipse form up until half of it was off-screen, then dragged the bottom edge of the frame, to extend it. I could then see there were more options to complete, and a selection list, that didn't show up before.

I'm using Eclipse on Linux by the way...

Jim
Also, make sure you have any target avaliable

http://developer.android.com/guide/developing/tools/avd.html said:
android list targets

If not, probably you ignored point 3. on the SDK setup

http://developer.android.com/sdk/index.html said:
3. Add Android platforms to your SDK
Use the Android SDK and AVD Manager, included in the SDK starter package, to add one or more Android platforms (for example, Android 1.6 or Android 2.0) to your SDK. In most cases, you will want to download multiple platforms, so that you can build your application on the lowest version you want to support, but test against higher versions that you intend the application to run on. Information about each platform is available at left, under "Downloadable SDK Components."
 
Upvote 0
Hey there!
This happens because your SDK is not installed.
Probably when running the setup you got the error:
Failed to fetch URL http://dl-ssl.google.com/android/eclipse/repository.xml, reason: File not found

So, you should go to:
settings > force https://... sources to be fetched using http://...
and check this option. Then try to install the packages again.
If you not succeed, find the file androidtool.cfg and add the following line:
sdkman.force.http=true

I hope it works.
Cheers!
 
Upvote 0
hello i am new to andriod... i have been trying to get the setup going for making my own apps.. i follwed all the steps..
downloaded the android sdk -android-sdk_r04-linux_86.tgz
all this works
ran android (the emultor) actulized the sdk from de dl-google. repos
then i downloaded the the ADT from eclipse.. this worked fine.. now i can run de AVD from with in eclipse, and in window - preferance- is the list of android sdks, i select android sdk 1.6 then apply ok.. window closes (i asume that this means all ok)
But then when i go to New - android project... i get an error saying that and SDK target must be selected....
i thought i did that in the previous step..
whats am i doing wrong??
 
Upvote 0
But then when i go to New - android project... i get an error saying that and SDK target must be selected....
i thought i did that in the previous step..
whats am i doing wrong??

Whats your screen resolution? anything below 1280x1024 will cause the new project dialog to collapse ... which means you don't see the "select target" portion of the new project dialog. you need to resize the dialog until you can select a target.

If the project is already created..... in the project / package explorer (folder view left hand window pane), right click your project and select properties.

In the "Properties for XXX" dialog select "android" option on the left, select a target in the main window of the dialog and then Apply / OK.

You should be able to to then rebuild / run the project successfully.
 
Upvote 0

Your 800 vertical pixels is not sufficient for the dialog as mentioned above. It has collapsed the "build target" widget on screen so you don't see any build targets to select. You need to make the window taller.

On a linux system you can hold down the alt key and click drag the window up... so you can expand the bottom frame of the window down. Continue moving the window this way until you can select a build target from the list.

Once you have a build target selected, you can always change the current build target for the project, under the projects properties page, which I mentioned in my last post.


This is the properties page for eclipse, not an existing project properties page.
 
Upvote 0
I figured out to do it, with Win7, and SDK of r04...

Alright what I did, was I started Eclipse>Window>Preferences>Android SDK and AVD Manager>On the left click Available Packages>Check mark the https://dl-ssl.google...etc> Now uncheck every single box,(but the website one at the top, of course.)>Now check that is closest to the top with the regular android, green alien sign, and not the one where it is gray with a plus sign.

For me the only one I checked was the one that said SDK Platform Android 2.0.1, API7, revision1... or something around those lines.

For some reason, installing them all at once did not work for me, which was a waist of 2 and a half hours... let me know if this helped, or if you need something clarified
 
Upvote 0
On a linux system you can hold down the alt key and click drag the window up... so you can expand the bottom frame of the window down. Continue moving the window this way until you can select a build target from the list.

I followed KeithG's suggestion again, Yes it works! Thanks much!

As a little clarification:
1) Hold down Alt-key while dragging the dialog-box "New Android Project" upward until its bottom is revealed -- you will find it's a very tall window.

2) Press Alt-F8, and now you can expand the dialogue box downward, until the "Build-Target list box fully appears
 
Upvote 0
Check if you have the directories like "android <sdk target>" in <sdk-home>/platforms .
<sdk target> can be 1.1, 1.5, 1.6 or something like that.
I have them but eclipse still cant find them while creating a new project project. The " build target" field is still empty.

Help needed.

Thanks in advance.

I have same problem, but read this replay still do not understand how to solve it. I read whole thread anwer still can not find real anwer. Totally how to sovle the probme "New Android Project An SDK Target must be specified"
 
Upvote 0
Hi, i just solved this problem on Eclipse Galileo on Ubuntu 8.04, Please follow steps:

A. Cause
Not select Device on "Build Target"

B. Solution:
Step 1. Check install SDK follow instruction
Adding SDK Components | Android Developers

Step 2. Create an AVD (Android Virtual Device) by command follow instruction:
Hello, World | Android Developers

Or creat AVD by Window -> Android SDK and AVD Manager -> Virtual Device -> New -> Setting your new devive

Step 3. Creat New Project
File -> New -> Project -> Android Project -> Select Build target
(If you can't select check box "Build target" there are 2 solution for solved it
1. Select by continous press tab for select Device on Build target
2. Resise "New Android Project" window to large size (Or increase your resolution of screen) till you can select an item in Build target

Regards
 
  • Like
Reactions: huynp85
Upvote 0
I was just recently having this same issue, I'm running Fedora 12 Linux, but I'll probably also be installing Eclipse on my Windows 7 partition. I was trying everything... not even Tab (until I enter the window) and enter would work - you have to click on the SDK or something of the sort, but hey - does everyone who had this problem run their OS on a widescreen monitor? I thought I saw complaints/issues from Win7/UNIX users alike... hm... you never know.

However, I did look at "Test Project" (an option right under "New Android Project" for me), and they had the SDK Target window out and ready to be clicked.

Oh, well, it's working now, and I may start developing WOOHOO!
 
Upvote 0
I have same problem, but read this replay still do not understand how to solve it. I read whole thread anwer still can not find real anwer. Totally how to sovle the probme "New Android Project An SDK Target must be specified"


I has same issue in Eclipse. I RESOLVED it.
PLEASE MAKE SURE YOU PUT '\' at the end of SDK Location. My Targets were also empty earlier. After inserting '\' at the end of location , I got targets populated. Hope this will help
<Your dir>\android-sdk-windows\
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones