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

  • Home
  • SEARCH
  • 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 4045688
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:27:53+00:00 2026-05-20T13:27:53+00:00

With the ADT plug-in installed, the following builders are active for an Android project:

  • 0

With the ADT plug-in installed, the following builders are active for an Android project:

  • Android Resource Manager
  • Android Pre Compiler
  • Java Builder
  • Android Package Builder

Looking at the output directory, the following artifacts are created:

  • resources.ap_ (just an APK/ZIP with resources and no code)
  • gen/R.java (autogenerated list of resources)
  • .class files with java bytecode
  • classes.dex
  • ${project-name}.apk

For my project, I autogenerate several code artifacts and in general need tighter control of the build process. At first, I figured that the Resource Manager was responsible for creating resources.ap_, the precompiler created R.java, java builder did the obvious, and then the Android Package Builder created classes.dex, then combined classes.dex and resources.ap_ to create the APK file.

I disabled the first two steps and created a custom pre-builder that laid down a copy of resources.ap_, figuring this would be equivalent. No such luck.

Unfortunately, the final Android Package Builder seems to slurp the resources directly from res/ and ignores my resources.ap_. In fact, the first two build steps don’t seem to do much other than generate R.java.

This is where it gets really problematic. If I disable the final build step and lay down my own APK file (with the exact same name), I get the following error:

[2011-02-27 20:25:28 - android-premium] ------------------------------
[2011-02-27 20:25:28 - android-premium] Android Launch!
[2011-02-27 20:25:28 - android-premium] adb is running normally.
[2011-02-27 20:25:28 - android-premium] Could not find android-premium.apk!

So I’m stuck: with the Android Package Builder (which has no discernable configuration), I have to supply individual ./res/ files. Without it, I can’t get the project to launch on the device (not from Eclipse).

Anyone have any better ideas / experience in this space?

  • 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-20T13:27:54+00:00Added an answer on May 20, 2026 at 1:27 pm

    Regarding Ant scripts, the following is my all-in-one template of the Ant steps for building an Android app (this might be useful to others trying to translate the Eclipse build to Ant as it is much simpler and more transparent than the opaque version autogenerated with the android tools):

    <property name="workspace.dir" value="/workspace" />
    <property name="project.dir" location="." />
    <property name="android-platform.name" value="android-1.5" />
    
    
    <!-- Framework Paths -->
    <property name="android-sdk.dir" value="${workspace.dir}/EpicFramework/android-sdk"/>
    <property name="android-tools.dir" value="${android-sdk.dir}/tools" />
    <property name="android-platform.dir" value="${android-sdk.dir}/platforms/${android-platform.name}" />
    <property name="android-platform-tools.dir" value="${android-platform.dir}/tools"/>
    <property name="android-platform-jar" value="${android-platform.dir}/android.jar"/>
    <property name="android-framework-src.dir" value="${workspace.dir}/EpicFramework/EpicAndroid"/>
    
    <!-- Tool Binaries -->
    <property name="adb" value="${android-tools.dir}/adb"/>
    <property name="apkbuilder" value="${android-tools.dir}/apkbuilder"/>
    <property name="aapt" value="${android-platform-tools.dir}/aapt"/>
    <property name="dx" value="${android-platform-tools.dir}/dx"/>
    
    <!-- Project Paths -->
    <property name="src.dir"   value="${project.dir}/src" />
    <property name="gen.dir"   value="${project.dir}/gen" />
    <property name="res.dir"   value="${project.dir}/res" />
    <property name="lib.dir"   value="${project.dir}/lib" />
    <property name="build.dir" value="${project.dir}/bin" />
    <property name="build.classes.dir" value="${build.dir}/classes" />
    
    <property name="resources.file" value="${build.dir}/resources.ap_"/>
    <property name="dex.file" value="${build.dir}/classes.dex" />
    <property name="debug-apk.file" value="${build.dir}/${ant.project.name}-debug.apk"/>
    
    
    <target name="dirs">
        <echo>Creating output directories if needed...</echo>
        <mkdir dir="${res.dir}" />
        <mkdir dir="${gen.dir}" />
        <mkdir dir="${lib.dir}" />
        <mkdir dir="${build.dir}" />
        <mkdir dir="${build.classes.dir}" />
    </target>
    
    <target name="android-resource-src" depends="dirs">
        <echo>Generating R.java from the resources...</echo>
        <exec executable="${aapt}" failonerror="true">
            <arg value="package" />
            <arg value="-M" />
            <arg path="AndroidManifest.xml" />
            <arg value="-S" />
            <arg path="${res.dir}" />
            <arg value="-I" />
            <arg path="${android-platform-jar}" />
            <arg value="-m" />
            <arg value="-J" />
            <arg path="${gen.dir}" />
        </exec>
    </target>
    
    <target name="android-compile" depends="android-resource-src">
       <echo>Compiling java files into class files...</echo>
        <javac 
          encoding="ascii"
          target="1.5"
          debug="true"
          extdirs=""
          destdir="${build.classes.dir}"
          includeAntRuntime="false"
          bootclasspath="${android-platform-jar}">
            <src path="${android-framework-src.dir}" />
            <src path="${src.dir}" />
            <src path="${gen.dir}" />
            <classpath>
                <fileset dir="${lib.dir}" includes="*.jar"/>
            </classpath>
         </javac>
    </target>
    
    <target name="android-dex" depends="android-compile">
        <echo>Converting compiled files and 3rd party libraries into ${dex.file} ...</echo>
        <apply executable="${dx}" failonerror="true" parallel="true">
            <arg value="--dex" />
            <arg value="--output=${dex.file}" />
            <arg path="${build.classes.dir}" />
            <fileset dir="${lib.dir}" includes="*.jar"/>
        </apply>
    </target>
    
    <target name="android-package-resources">
        <echo>Packaging Android resources into ${resources.file} ...</echo>
        <exec executable="${aapt}" failonerror="true">
            <arg value="package" />
            <arg value="-M" />
            <arg path="AndroidManifest.xml" />
            <arg value="-S" />
            <arg path="./res" />
            <arg value="-I" />
            <arg path="${android-platform-jar}" />
            <arg value="-f" />
            <arg value="-F" />
            <arg value="${resources.file}" />
        </exec>
    </target>
    
    <target name="android-debug" depends="android-dex, android-package-resources">
        <echo>Packaging app and signing it with the debug key</echo>
        <exec executable="${apkbuilder}" failonerror="true">
            <arg value="${debug-apk.file}" />
            <arg value="-d" />
            <arg value="-z" />
            <arg value="${resources.file}/" />
            <arg value="-f" />
            <arg value="${dex.file}" />
        </exec>
    </target>
    
    <target name="android-release" depends="android-dex, android-package-resources">
        <echo>Packaging App without signing, so that it can be signed with the official publishing key ...</echo>
        <exec executable="${apkbuilder}" failonerror="true">
            <arg value="${release-apk.file}" />
            <arg value="-u" />
            <arg value="-d" />
            <arg value="-z" />
            <arg value="${resources.file}/" />
            <arg value="-f" />
            <arg value="${dex.file}" />
        </exec>
        <echo>All generated packages need to be signed with jarsigner before they are published.</echo>
    </target>
    
    <target name="android-install" depends="android-debug">
        <echo>Removing all com.epicapplications APK files from default emulator ...</echo>
        <exec executable="${adb}" inputstring="echo hi; rm -f /data/app/com.epicapplications.*; exit;
        ">
            <arg value="shell"/>
        </exec>
        <echo>Installing ${debug-apk.file} onto default emulator...</echo>
        <exec executable="${adb}" failonerror="true">
            <arg value="install" />
            <arg value="-r" />
            <arg path="${debug-apk.file}" />
        </exec>
    </target>
    

    What I am looking for is to be able to use all or fragments of this Ant build script, but still have the Eclipse integration for launching and debugging the app.

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

Sidebar

Related Questions

I'm following the MapView tutorial on the Android website [2010-08-22 11:12:24 - com.android.ide.eclipse.adt.internal.project.AndroidManifestParser] Parser
I'm trying to go deep into Dictionary ADT and Skip List for Java. My
I am facing a problem of installing ADT from https://dl-ssl.google.com/android/eclipse/ and http://dl-ssl.google.com/android/eclipse/ It shows
Trying to work with Eclipse for Android (ADT plugin) development at my iMac (2.4Ghz,
I'm setting up Eclipse for Android and when attempting to install the ADT plugin,
I'm using Eclipse 3.5.2 and when I followed the steps on this tutorial( http://developer.android.com/guide/developing/tools/adt.html
What is the difference between a Hash Map and dictionary ADT. And when to
On a fresh install of Eclipse: Eclipse - 3.52 Galileo-SR2-win32 Java Version - JRE
Has anyone had success developing a substantial Android app in Scala? Is it a
/** @file ListP.cpp * ADT list - Pointer-based implementation. */ #include <iostream> #include <cstddef>

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.