Take the 2-minute tour ×

I am getting the following error on NetBeans 7.0 trying to run a HelloAndroid application. The Android SDK as well as an Android device have already been detected by NetBeans, and I followed all the instructions given.

C:\Program Files (x86)\Android\android-sdk\tools\ant\build.xml:421: Android Target is not set.

share|improve this question
possible duplicate of Project has no target set. Edit the project properties to set one –  Lukas Knuth Oct 24 '11 at 11:21
add comment

3 Answers

I have had the same issue. It has to do with how the Android application is build in the new version of the SDK. Here is what helped for me: Go to your Project Properties file you will find something like


I think you can safely delete this. However Netbeans will create it again if you go to the properties of the project by using right click.

Go to Pre-user properties file. There should already be a setting sdk.dir which shows the path to your sdk directory. Add a new setting:


As you may have guessed, replace android-10 with the API Version you want to use.

share|improve this answer
add comment

I think its problem in build.xml. Find this file in left windows.

Find in build.xml this code: <property file="default.properties" />

change with : <property file="project.properties" />

save..and finish... run again

sorry about my english

share|improve this answer
add comment

Thanks last_id, it works :-). But the build.xml will be overwritten everytime you change the android target device. There should be a better solution - may be, the android plugin has a bug?

However, I do the following now as a workaround.


1) Adding <property file="project.properties" /> or overwriting <property file="default.properties" />, as you suggest, and then mark the file as "read only". There may be no reason to change it anymore. Pay attention: removing the project by NetBeans itself won't work completely.


2) for Linux/U**x: not 1), but replacing the empty (!) file default.properties by a sym-link to project.properties. So, project.properties may change, but it doesn't matter :-). And a later removing of the project will work.

share|improve this answer
add comment

Your Answer


