MuntashirAkon/AppManager · warning · IOException

APK is larger than 650 MB.

Error message

APK is larger than 650 MB.

What it means

During the VT upload path, fetchFileReportOrScan checks the file size and throws IOException("APK is larger than 650 MB.") when it exceeds 650,000,000 bytes, since VirusTotal rejects uploads above ~650 MB.

Solutions

  1. Check file.length() <= 650_000_000 before invoking VT scanning and skip VT for larger files.
  2. Scan a smaller subset (e.g. base APK or individual dex files) instead of the whole archive.
  3. Catch IOException and surface a clear 'file too large for VirusTotal' message.

Example fix

// before
vt.fetchFileReportOrScan(largeApk); // throws for >650MB
// after
if (new File(path).length() > 650_000_000L) {
    showNotice("File too large for VirusTotal; skipping.");
} else {
    vt.fetchFileReportOrScan(file);
}
Defensive patterns

Strategy: validation

Validate before calling

if (file.length() > 650_000_000L) {
    throw new IllegalArgumentException("File exceeds VirusTotal's 650 MB upload limit.");
}

Try / catch

try {
    VtFileReport r = vt.fetchFileReportOrScan(file);
} catch (IOException e) {
    if (e.getMessage().contains("650 MB")) showNotice("File too large for VirusTotal.");
}

Prevention

When it happens

Trigger: Calling fetchFileReportOrScan on a file whose length() exceeds 650_000_000 bytes and which is not already present in VT (upload path taken).

Common situations: Scanning very large APKs/obb bundles/game archives; attempting VT analysis of oversized split-APK merges.

Understand the failure class

Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.

Related errors


AI-assisted analysis of MuntashirAkon/AppManager@0152f468fc (2026-09-12). Data as JSON: /api/errors/cdff23941fcb3d18. Report an issue: GitHub.

Appendix: source

Thrown at app/src/main/java/io/github/muntashirakon/AppManager/scanner/vt/VirusTotal.java:134

            // Retry is not available
            throw new FileNotFoundException("Fetch error: " + responseReport.error);
        }
        // Scan or retry
        VtError error = Objects.requireNonNull(responseReport.error);
        boolean waitFirst = false;
        if ("NotFoundError".equals(error.code)) {
            // Initiate scan
            if (!response.uploadFile()) {
                // Scanning disabled
                throw new FileNotFoundException("File not found in VirusTotal.");
            }
            waitFirst = true;
            PowerManager.WakeLock wakeLock = CpuUtils.getPartialWakeLock("vt_upload");
            wakeLock.acquire();
            try {
                long fileSize = file.length();
                if (fileSize > 650_000_000) {
                    throw new IOException("APK is larger than 650 MB.");
                }
                boolean largeFile = fileSize > 32_000_000L;
                response.onUploadInitiated();
                String filename = file.getName();
                ResponseV3<String> uploadResponse;
                try (InputStream is = file.openInputStream()) {
                    uploadResponse = largeFile
                            ? uploadLargeFile(filename, is)
                            : uploadFile(filename, is);
                }
                if (uploadResponse.response != null) {
                    response.onUploadCompleted(getPermalink(checksum));
                }
            } finally {
                CpuUtils.releaseWakeLock(wakeLock);
            }
        }
        int waitDuration = 60_000;

View on GitHub (pinned to 0152f468fc)