Reputation: 11
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.
Upvotes: 1
Views: 2361
Reputation: 1
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.
Either
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.
or
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.
Upvotes: 0
Reputation: 11
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
Upvotes: 1
Reputation: 391
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
target=android-10
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:
target.api=android-10
As you may have guessed, replace android-10
with the API Version you want to use.
Upvotes: 1