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 3594554
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T19:43:45+00:00 2026-05-18T19:43:45+00:00

I wanna build one app into 2 version, one paid, one free, and I

  • 0

I wanna build one app into 2 version, one paid, one free,
and I know aapt have a option “–rename-manifest-package” should help, but I don’t know How to use it in build.xml.
I find 2 place I may modify:

 <!-- first -->
 <target name="-resource-src" depends="-dirs">
    <echo>Generating R.java / Manifest.java from the resources...</echo>
    <exec executable="${aapt}" failonerror="true">
        <arg value="package" />
        <arg line="${v.option}" />
        <arg value="-m" />
        <arg value="-J" />
        <arg path="${gen.absolute.dir}" />
        <arg value="-M" />
        <arg path="AndroidManifest.xml" />
        <arg value="-S" />
        <arg path="${resource.absolute.dir}" />
        <arg value="-I" />
        <arg path="${android.jar}" />       
    </exec>
</target>



 <!-- sencod -->
 <target name="-package-resources">
    <echo>Packaging resources</echo>
     <aaptexec executable="${aapt}"
            command="package"
            manifest="AndroidManifest.xml"
            resources="${resource.absolute.dir}"
            assets="${asset.absolute.dir}"
            androidjar="${android.jar}"
            outfolder="${out.absolute.dir}"
    basename="${ant.project.name}" >
</aaptexec>
</target>

this article( http://blog.uncommons.org/2010/07/19/building-two-versions-of-the-same-android-app/ ) said I should adding “–rename-manifest-package” at the second place, but How?

  • 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-18T19:43:46+00:00Added an answer on May 18, 2026 at 7:43 pm

    The option –rename-manifest-package cannot be used with the aaptexec ant task. It is an option that needs to go straight to the aapt executable, like this;

    <exec executable="${aapt}" failonerror="true">
      <arg value="package" />
      <arg value="-f" />
      <arg value="-v" />
      <arg value="--version-code" />
      <arg value="${version.code}" />
      <arg value="--debug-mode" />
      <arg value="-M" />
      <arg path="AndroidManifest.xml" />
      <arg value="-A" />
      <arg path="${asset.absolute.dir}" />
      <arg value="-I" />
      <arg path="${android.jar}" />
      <arg value="-F" />
      <arg path="${out.absolute.dir}/${resource.package.file.name}" />
      <arg value="-S" />
      <arg path="${resource.absolute.dir}" />
      <arg value="--rename-manifest-package" />
      <arg value="com.example.pro" />
    </exec>
    

    I found no way of editing a file that actually changes the way Eclipse builds. So I put that piece of code in the build.xml, put it in the project root, and built from the console by typing;

    ant debug
    

    And if you depend on any libraries, they need to go into the packaging as well. Look into your default.properties file and you’ll see the reference to the lib. Then add that to the rule above, like this;

    <arg value="-S" />
    <arg path="${android.library.reference.1}/res" />
    

    It starts to feel more and more like a hack that can break with any platform SDK update.

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

Sidebar

Related Questions

I wanna build a console app that may stop and prompt for some input,
I wanna use a rendering engine with QCAR (vuforia) to build an AR app.
I wanna build a Win32 app of Client/Server (or 3-tier) type with follow features:
I wanna build a client server iphone app and for this i need to
So I have created a piece of software which I wanna package and post
I wanna build an app similar to MS office kinda thing; The issue is
I wanna build a gallery, but the my problem is how to load the
I wanna check sharepoint title first and see if the lib doesn't have that
I wanna build my own chat client using xmpp on android to chat with
I wanna start with first program in PHP. I have got installed xampp and

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.