openclaw/openclaw · error · Error

Missing value for --verify-apk

Error message

Missing value for --verify-apk

What it means

Thrown by parseArgs when `--verify-apk` is the last argument, has no following token, or its token starts with '-' (looks like another flag). The verify-apk mode requires a path to an existing APK to verify; an absent or flag-like value is treated as a missing operand.

Source

Thrown at apps/android/scripts/build-release-artifacts.ts:182

    const arg = argv[index];
    switch (arg) {
      case "--artifact": {
        const value = argv[index + 1];
        if (value !== "all" && value !== "play" && value !== "wear" && value !== "third-party") {
          throw new Error("--artifact must be one of: all, play, wear, third-party");
        }
        artifact = value;
        index += 1;
        break;
      }
      case "--dry-run": {
        dryRun = true;
        break;
      }
      case "--verify-apk": {
        const value = argv[index + 1];
        if (!value || value.startsWith("-")) {
          throw new Error("Missing value for --verify-apk");
        }
        verifyApk = value;
        index += 1;
        break;
      }
      case "-h":
      case "--help": {
        console.log(
          [
            "Usage: bun apps/android/scripts/build-release-artifacts.ts [--artifact all|play|wear|third-party] [--dry-run] [--verify-apk PATH]",
            "",
            "Builds the signed phone, Wear, and third-party Android artifacts.",
          ].join("\n"),
        );
        process.exit(0);
      }
      default: {
        throw new Error(`Unknown argument: ${arg}`);

View on GitHub (pinned to 01804a7531)

Solutions

  1. Provide a real APK path: `--verify-apk apps/android/app/build/outputs/apk/release/app-release.apk`.
  2. If the path may begin with '-', prefix `./' so it does not look like a flag.
  3. Ensure any shell variable used for the path is set and non-empty.

Example fix

// before
bun build-release-artifacts.ts --verify-apk
// after
bun apps/android/scripts/build-release-artifacts.ts --verify-apk ./app-release.apk
Defensive patterns

Strategy: validation

Validate before calling

function requireValue(flag: string, value: string | undefined): string {
  if (!value || value.startsWith('-')) throw new Error(`Missing value for ${flag}`);
  return value;
}

Type guard

const isRealArgValue = (v: string | undefined): v is string =>
  typeof v === 'string' && v.length > 0 && !v.startsWith('-');

Prevention

When it happens

Trigger: `--verify-apk` with nothing after it; `--verify-apk --dry-run` (next token is a flag); `--verify-apk -h`; quoted empty string `--verify-apk ""`.

Common situations: Operators forgetting the path; shell collapsing an undefined env var to empty; argument-order mistakes.

Related errors


AI-assisted analysis of openclaw/openclaw@01804a7531 (2026-08-12). Data as JSON: /api/errors/442efed4e8104671. Report an issue: GitHub.