shwenzhang/AndResGuard · error

the signature file do not exit, raw path=

Error message

the signature file do not exit, raw path= %s

What it means

Configuration.setSignData throws IOException('the signature file do not exit, raw path= %s') when signature-based APK signing is enabled (mUseSignAPK=true) but the provided keystore/signature File does not exist on disk.

Solutions

  1. Check signatureFile.exists() before constructing Configuration and fail early with a clear message.
  2. Use an absolute path (or resolve the path against the project root) for the keystore.
  3. Ensure the keystore is provisioned in CI (secret file injected, correct workspace path).

Example fix

// before
config.setSignData(new File("debug.keystore"), pass, alias, storePass);
// after
File ks = new File(project.getRootDir(), "signing/debug.keystore");
if (!ks.isFile()) throw new GradleException("keystore not found: " + ks.getAbsolutePath());
config.setSignData(ks, pass, alias, storePass);
Defensive patterns

Strategy: validation

Validate before calling

File ks = new File(signaturePath); if (!ks.isFile()) throw new IllegalArgumentException("keystore not found: " + ks.getAbsolutePath());

Try / catch

try { config.setSignData(f, pass, alias, storePass); } catch (IOException e) { throw new GradleException("invalid signing config: " + e.getMessage()); }

Prevention

When it happens

Trigger: Building Configuration from CLI/gradle options where -signature/keystore path is set (via setSignData called from the Configuration constructor) but the keystore file path is wrong, relative to the wrong working directory, or the file was never generated.

Common situations: CI machines missing the keystore because it is git-ignored; relative keystore path resolved against a different working directory; renaming the keystore without updating the config.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


AI-assisted analysis of shwenzhang/AndResGuard@e4df245d82 (2026-09-12). Data as JSON: /api/errors/67389d7e44817997. Report an issue: GitHub.

Appendix: source

Thrown at AndResGuard-core/src/main/java/com/tencent/mm/resourceproguard/Configuration.java:154

    mUse7zip = param.use7zip;
    mKeepRoot = param.keepRoot;
    mMergeDuplicatedRes = param.mergeDuplicatedRes;
    mMetaName = param.metaName;
    mFixedResName = param.fixedResName;
    for (String item : param.compressFilePattern) {
      mUseCompress = true;
      addToCompressPatterns(item);
    }
    this.m7zipPath = param.sevenZipPath;
    this.mZipalignPath = param.zipAlignPath;
  }

  private void setSignData(
      File signatureFile, String keypass, String storealias, String storepass) throws IOException {
    mUseSignAPK = true;
    mSignatureFile = signatureFile;
    if (!mSignatureFile.exists()) {
      throw new IOException(String.format("the signature file do not exit, raw path= %s\n",
          mSignatureFile.getAbsolutePath()
      ));
    }
    mKeyPass = keypass;
    mStoreAlias = storealias;
    mStorePass = storepass;
  }

  private void setKeepMappingData(File mappingFile) throws IOException {
    if (mUseKeepMapping) {
      mOldMappingFile = mappingFile;

      if (!mOldMappingFile.exists()) {
        throw new IOException(String.format("the old mapping file do not exit, raw path= %s",
            mOldMappingFile.getAbsolutePath()
        ));
      }
      processOldMappingFile();

View on GitHub (pinned to e4df245d82)