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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:22:45+00:00 2026-06-08T23:22:45+00:00

I have been told that there is a way to use aapt’s –version-code option

  • 0

I have been told that there is a way to use aapt’s --version-code option to add/insert a version code into an APK whose manifest doesn’t define one. However, I haven’t found any examples of people doing this (except for https://groups.google.com/forum/#!msg/adt-dev/XjehZDzfXhk/g2sWBC37_I4J, which links to a dead page and isn’t even the same thing I am trying to do) if indeed it is possible to do.

Currently aapt d badging example.apk run on the apk in question returns something like

package: name=’com.example.core’ versionCode=” versionName=’1.0.0′
sdkVersion:’8′

In my manifest I currently have the versionName defined as a string in an xml file, so I can pull it in with something like android:versionName="@string/app_version_name" (inside the manifest tag). However, if I try this with the version code it doesn’t seem to want to resolve the reference. It tries to literally set the version code to the path I enter and then fails as it isn’t an integer.

I’ve tried to do something like aapt p --version-code 100 example.apk but it seems to want to package up a whole project and expects a directory of files as input, not an apk file. (I assume that is the default behavior of aapt p[ackage])

Is it possible to set the version code of an APK after it has been built using the aapt tool? If so, what is the correct syntax?

  • 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-06-08T23:22:47+00:00Added an answer on June 8, 2026 at 11:22 pm

    This solution will not use aapt directly, but it will behind the scenes.

    You can use Android APKTool to open you APK, alter the AndroidManifest.xml file, adding the version info; and then use APKTool again to repack. That tool is opensource and uses aapt. Thus you can look at its code to figure out how to do it using aapt directly.

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

Sidebar

Related Questions

I have been told that there is a performance difference between the following code
I'm confused about this. Most of us have been told that there isn't any
I have previously been told that I should always use Randomize() before I use
There have been many threads started over the confusion in the way that Math.Round
I have been told that Eclipse is a good tool for programming in certain
I am building a web application and have been told that using object oriented
i have been told to use 'when' statement to make multiplexer but not use
I'm using Jira and have been told by the sysadmin that GreenHopper has been
I am learning about preconditions and when to use them. I have been told
I have been told that disabling backreferences in perl improves performance (provided you're not

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.