Skip to content
webtoapkfree

Can I convert an APK to an AAB?

There's no official way to convert an APK to an AAB. Rebuild the AAB from your project, or rebuild the module by hand with bundletool.

GuidesNookesh Karri

Light cover card with the title 'Can I convert an APK to an AAB?' in dark text and a green accent bar

You can’t convert an APK to an AAB with an official one-click tool, because Google doesn’t make one. The reliable way to get an AAB is to build it again from your project with Android Studio or Gradle. If the source is truly gone, you can rebuild the bundle by hand from the APK’s parts with apktool, aapt2 and bundletool, but treat that as a rescue job, not a normal workflow.

Why you can’t just convert an APK to an AAB

An APK and an AAB hold similar things in different shapes. The Android docs describe an Android App Bundle as a publishing format with all your compiled code and resources that defers APK generation and signing to Google Play. Play then builds optimized APKs for each device.

The resources are the problem. Google’s command-line build guide says a bundle’s manifest and resource table must be in protobuf format, produced by aapt2 link --proto-format. A finished APK stores them in the binary format phones read. “Converting” means unpacking the APK, recompiling its resources and repacking everything into a new module layout.

Why Google Play wants an AAB at all

Google Play asks for an AAB because new apps must publish in that format. The Play Console help page states: “Starting August 2021, new apps are required to publish with the Android App Bundle on Google Play.”

When Google announced it, the Android Developers Blog added that existing apps were exempt at the time, as were private apps published to managed Google Play users. Our post on what is replacing APK files on Google Play covers the history.

Pick your route

Which route works depends on what you still have.

Your situation What to do
You have the project Build the AAB with Android Studio or Gradle
You used a builder tool Export the AAB from the same project in that tool
You only have the APK Rebuild the module by hand with apktool, aapt2 and bundletool
The app is already on Play with your own key Enroll in Play App Signing before uploading the AAB

You have the project: rebuild it

If you have the source project, build the AAB from it. Google’s build guide says “The easiest way to build an app bundle is by using Android Studio.” From a terminal, Gradle’s bundleVariant task does the same job:

./gradlew :base:bundleDebug

For a release build, Gradle signs the bundle with the signing details in your build.gradle.kts. Keep the package name. Raise the version code, because Bayton lists “Version code too low” as a Play upload error when it is below the version already uploaded.

If a no-code or WebView builder made your APK, check whether it kept your project. Open it again and look for an AAB export before you reach for a converter.

You only have the APK: the manual bundletool route

Without the source, you can still assemble an AAB from the APK’s pieces. Google documents the bundletool steps for custom toolchains, and community tools such as go-apk2aab-tool script the same process for people who “can’t get” the project.

  1. Unpack the APK with apktool, keeping the dex files.
  2. Compile the resources with aapt2 compile.
  3. Link them in protobuf format with aapt2 link --proto-format, passing android.jar, the manifest and your version values.
  4. Lay out a module called base.zip with manifest/AndroidManifest.xml, dex/, res/, root/, assets/, lib/ and resources.pb.
  5. Build the bundle: bundletool build-bundle --modules=base.zip --output=mybundle.aab.
  6. Sign it before upload.

Two details trip people up. Google warns that the AAPT2 in the Android build tools package doesn’t support bundletool, so download the one from Google’s Maven repository. And go-apk2aab-tool has you edit the version numbers by hand, so check them for each APK.

Signing the AAB is different from signing an APK

An AAB is signed with jarsigner, not apksigner. Google’s build guide gives the command as:

jarsigner -keystore pathToKeystore app-release.aab keyAlias

and notes that “You cannot use apksigner to sign your app bundle.” If you learned signing from our guide to signing an APK from the command line, this is where muscle memory fails you.

You sign the bundle with your upload key. Per the Play App Signing help page, you hold that key and Google can reset it if it’s lost. Google keeps the separate app signing key that users’ devices see.

The app is already on Google Play with your own key

Replacing an APK with an AAB on an existing listing needs one extra step. Bayton’s list of Play upload errors includes “For uploading an App Bundle you must be enrolled in Play App Signing”, and the fix is to enroll before you swap formats.

If you’ve managed your own key, Google’s help page says you upgrade by transferring a copy of it. The PEPK tool encrypts and uploads your existing app signing key. Google recommends creating a new upload key at the same time. Our post on signed vs unsigned APKs explains what that signature does.

My take: rebuild, don’t convert

Use the manual route only when the source is gone for good. A hand-assembled bundle is only as good as apktool’s decoding, and the community scripts I found include no testing steps. A rebuild gives you a clean bundle, a proper signing config and an app you can still update next month.

If you do convert, push it to Play’s internal testing track, install it on a real phone and open every screen. Our post on the closed testing rule for new personal accounts covers what they need before production anyway.

If you built the app with webtoapkfree.com

You don’t need a converter. The builder produces a signed APK for testing on your phone and an AAB for Google Play from the same project, so open your project and download the AAB. Packaging and signing happen in your browser, and the signing key isn’t uploaded to a build server.

The limitation: webtoapkfree.com can’t import an existing APK, and it can’t import JKS or P12 keystores, only its own encrypted key backups. It can’t convert an APK made elsewhere or sign with an upload key from another tool. It builds from a website, self-contained HTML or text pages.

FAQ

Is there an official APK to AAB converter from Google?

No. Google’s documentation builds app bundles from your project with Android Studio, Gradle or bundletool. None of those take a finished APK as input.

Can I sign an AAB with apksigner?

No. Google’s command-line build docs say you can’t use apksigner to sign an app bundle. Use jarsigner, or let Gradle sign it from your signing config.

Do I need an AAB to update an old app on Google Play?

The AAB requirement announced in 2021 applied to new apps, and existing apps were exempt at the time. To replace an APK with an AAB on an existing app, you need to enroll in Play App Signing first.

Is an online APK to AAB converter safe?

You’d be handing your app, and possibly your signing key, to a third party. If you have the project, rebuilding locally is safer and gives a cleaner result.

Sources