Google Play Console rejected upload: "APK is not zip aligned" error how to fix
Fixes APK is not zip aligned in a mobile release pipeline by working through the specific checks and corrections for this failure. Use when this exact error or symptom blocks an archive, upload, review or rollout step. Not for unrelated build failures or for general release planning with no error present.
TL;DR
Run zipalign on the APK after signing, or switch to an Android App Bundle which Play aligns automatically. For a legacy APK pipeline, align with the zipalign tool from the Android SDK build-tools using a 4-byte alignment before uploading, and verify with the alignment check flag. Never align before signing with apksigner v2, because aligning after that signature invalidates it; the correct order is sign with apksigner, then zipalign is wrong for v2 - use the documented order for your signer and verify the final file.
APK is not zip alignedUse this when
- Play Console rejects an APK upload with the zip aligned message.
- You sign APKs manually with jarsigner or an old build script.
- A custom packaging step modifies the APK after the Gradle build.
Not for this skill when
- You upload AABs only. Bundles do not need manual zipalign; look for a different rejection reason.
- The APK is corrupt rather than unaligned. A failed zip integrity test is a separate problem.
Steps
- Confirm the artefact type you uploaded and whether any post-build script touches the APK after Gradle or apksigner finishes. Verify: the pipeline steps touching the APK are listed in order
- Run the zipalign verification mode on the uploaded file to confirm the alignment state. Verify: the tool reports the APK is not aligned, matching the Console error
- Align the signed APK using zipalign from the same build-tools version as your compile SDK, writing to a new output file. Verify: zipalign completes and produces the aligned output file
- Re-verify alignment on the output file and re-check the signature still validates. Verify: verification reports aligned and the signature check passes
- Upload the aligned file to Play Console as a new release artefact. Verify: Console accepts the APK with no zip align rejection
- Remove any pipeline step that rezips or modifies the APK after alignment, or migrate the release to an AAB. Verify: the next CI build passes Console validation without manual alignment
- Record the fix in the release runbook or the CI job notes, naming the error, the value or setting that changed, and the date, so the next release engineer does not re-diagnose it from scratch. Verify: the runbook or job notes contain an entry for this error that a teammate can find by searching the error text
Why it happens
ZIP entries in an APK should start on 4-byte boundaries so Android can memory-map resources directly without copying. Gradle normally aligns release APKs automatically, so an unaligned upload means a manual signing or repackaging step ran after alignment, or an ancient toolchain produced the file. Play enforces alignment at upload because unaligned APKs waste memory on every device.
In practice this failure is rarely a one-off. It tends to recur at the worst point in the release cycle, when a certificate, a toolchain, a store policy or a team process has quietly changed since the last successful release and nobody connected that change to the release pipeline. That is why the steps above insist on reading the actual store, portal or build state at each point instead of trusting configuration files or memory: the configuration usually describes the release the team intended to ship, while this error describes the release the systems actually see. Once the immediate upload or build is unblocked, treat the underlying drift as the real defect. Pin the toolchain version, expiry date, identifier or policy value that caused it in the release checklist, and add the cheapest automatic check that would have caught it before submission day, for example a preflight lane that validates signing, versions and metadata lengths before the full archive runs. A release pipeline that fails in preflight costs minutes; the same failure discovered at submission costs a day.
Variants and edge cases
APK is not zip aligned Play Console fix
The Console phrasing; align and re-verify before re-upload. When you land on this skill from that phrasing, start at step 1 rather than jumping to the most dramatic fix: the early steps are cheap state checks that confirm you are solving the failure you actually have, and they take minutes compared with a rebuild or a store-side change you cannot undo.
zipalign error Android release upload
Tool-level phrasing for manual APK pipelines. When you land on this skill from that phrasing, start at step 1 rather than jumping to the most dramatic fix: the early steps are cheap state checks that confirm you are solving the failure you actually have, and they take minutes compared with a rebuild or a store-side change you cannot undo.
Edge case: apksigner ordering
With apksigner, alignment must happen before signing; with older jarsigner flows it happened after. Match the order to your signer and always verify the final artefact. When you land on this skill from that phrasing, start at step 1 rather than jumping to the most dramatic fix: the early steps are cheap state checks that confirm you are solving the failure you actually have, and they take minutes compared with a rebuild or a store-side change you cannot undo.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_QjXZrHWoYWGVs9kRWeoxIQ