Android apps

Common Android .apk upload errors

Fixing error 4001502 (corrupt binary AndroidManifest.xml), unsigned APKs, and v1 vs v2/v3 APK Signature Schemes.

Error 4001502 — Invalid .apk file

BuildDrop returns error 4001502 when an uploaded .apk is not a valid compiled Android package:

  • Plain .zip renamed to .apk: A valid .apk must contain a compiled binary AXML AndroidManifest.xml at the archive root—raw source XML files will not parse or install on Android.
  • Truncated build artifact: Verify your CI job finished writing app-release.apk before invoking POST /api/upload.
  • Unsigned -unsigned.apk output: Gradle's assembleRelease produces app-release-unsigned.apk when no signingConfig is configured. Android refuses to install unsigned APKs; configure a debug or release keystore before uploading.

APK Signature Scheme v1 vs v2/v3 certificate dates

  • When an .apk includes a v1 JAR signature (META-INF/*.RSA, *.DSA, or *.EC), BuildDrop extracts the X.509 signing certificate subject (CN=…) and exact expiration timestamp via OpenSSL.
  • Modern builds signed exclusively with APK Signature Scheme v2 / v3 (APK Sig Block 42 in the ZIP central directory) install normally on Android 7.0+; BuildDrop marks the v1 certificate validity date as APK Signature Scheme v2/v3 (date not embedded in META-INF) on /i/{hash}.