Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7548725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:46:17+00:00 2026-05-30T09:46:17+00:00

When running: ant release with my Android project, I get a ton of auto

  • 0

When running:

ant release  

with my Android project, I get a ton of auto generated files. For example:

MyApp-release-unaligned.apk 
MyApp-release-unsigned.apk  
MyApp-release-unsigned.apk.d    
MyApp-release.apk       
MyApp.ap_           
MyApp.ap_.d
build.prop
classes
classes.dex
classes.dex.d
res

I don’t want all these files. Basically all I need is the signed .apk. So I tried:

<target name="-post-compile">
    <!-- Clean up files that we don't want -->
    <delete dir="{$out.dir}res"/>
    <delete dir="{$out.dir}classes"/>
    <delete file="{$out.dir}${app.name}-release-unaligned.apk"/>
    <delete file="{$out.dir}${app.name}-release-unsigned.apk"/>
    <delete file="{$out.dir}${app.name}-release-unsigned.apk.d"/>
    <delete file="{$out.dir}${app.name}.ap_"/>
    <delete file="{$out.dir}${app.name}.ap_d"/>
    <delete file="{$out.dir}build.prop"/>
    <delete file="{$out.dir}classes.dex"/>
    <delete file="{$out.dir}classes.dex.d"/>
</target>

Evidently these files are generated after -post-compile is called. Is there an easy way to adjust the build.xml to remove all but the signed apk? My output directory is directed to a server and I would like to keep things simple there so that others don’t pull the wrong file. If there is no easy way to remove these files, I’ll build a server-side script to do it but I would prefer to keep everything in the build.xml if possible. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T09:46:19+00:00Added an answer on May 30, 2026 at 9:46 am

    You can add the target of removing the files as last line of the release command, however, I assume you don’t create your own release target as most Android developers. Then another alternative will be to expose your target as say <target name="remove-files"> and run the ant release like ant release,remove-files.

    However, I just wonder why are those files such a bug burden?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I configured my android project to use ant. When building using the keyword release
I'm trying to get a file with ant, using the get property. I'm running
When running ant from command line on my Netbeans projects, I get the following
I was just able to get Apache ANT running on my computer. The ant
I'm running ant and added the below to build.xml but I'm getting:\ build.xml:51: Element
Does anyone know of a simple web app that supports running ant tasks? Alternatively
Ant seems to be pretty bad as running interactive program. So for instance, a
I've been running the built-in Ant from the command line on a Macintosh (10.5.5)
I am working on an Ant target for running tests, and I need to
We have a CruiseControl server running various AntUnit, MbUnit and NUnit tests via Ant.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.