{"record":{"id":"21325dbb12a65622","repo":"shwenzhang/AndResGuard","slug":"can-not-found-any-signed-apk-file","errorCode":null,"errorMessage":"Can not found any signed apk file","messagePattern":"Can not found any signed apk file","errorType":"exception","errorClass":"java.io.IOException","httpStatus":null,"severity":"error","filePath":"AndResGuard-core/src/main/java/com/tencent/mm/androlib/ResourceApkBuilder.java","lineNumber":274,"sourceCode":"        \"-storepass\",\n        config.mStorePass,\n        \"-keypass\",\n        config.mKeyPass,\n        \"-signedjar\",\n        signedApk.getAbsolutePath(),\n        unSignedApk.getAbsolutePath(),\n        config.mStoreAlias\n    };\n    Utils.runExec(argv);\n  }\n\n  private void alignApks() throws IOException, InterruptedException {\n    //如果不签名就肯定不需要对齐了\n    if (!config.mUseSignAPK) {\n      return;\n    }\n    if (!mSignedApk.exists() && !mSignedWith7ZipApk.exists()) {\n      throw new IOException(\"Can not found any signed apk file\");\n    }\n    if (mSignedApk.exists()) {\n      alignApk(mSignedApk, mAlignedApk);\n    }\n    if (mSignedWith7ZipApk.exists()) {\n      alignApk(mSignedWith7ZipApk, mAlignedWith7ZipApk);\n    }\n  }\n\n  private void alignApk(File before, File after) throws IOException, InterruptedException {\n    System.out.printf(\"zipaligning apk: %s, exists:%b\\n\", before.getAbsolutePath(), before.exists());\n    if (!before.exists()) {\n      throw new IOException(String.format(\"can not found the raw apk file to zipalign, path=%s\",\n          before.getAbsolutePath()\n      ));\n    }\n    String cmd = Utils.isPresent(config.mZipalignPath) ? config.mZipalignPath : TypedValue.COMMAND_ZIPALIGIN;\n    Utils.runCmd(cmd, \"4\", before.getAbsolutePath(), after.getAbsolutePath());","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/shwenzhang/AndResGuard/blob/e4df245d82f27d9a2d0dd108260a3510cbaba849/AndResGuard-core/src/main/java/com/tencent/mm/androlib/ResourceApkBuilder.java#L256-L292","documentation":"alignApks runs after signing and zipaligns the signed APK (and the 7z-repacked variant). If neither mSignedApk nor mSignedWith7ZipApk exists on disk, signing must have failed to produce any output, so this IOException is thrown. It indicates the signing step upstream silently failed.","triggerScenarios":"buildApkWithV1sign -> alignApks with config.mUseSignAPK=true when signApkV1 (and/or the 7z repackage) did not produce any signed APK file — typically because jarsigner or apksigner failed earlier and the failure was only logged.","commonSituations":"Build continues after a signing warning on CI; keystore credentials wrong so no signed jar was written; 7z repackage disabled and the plain signed APK missing; output directory not writable so signed APK creation failed.","solutions":["Fix the underlying signing failure — inspect earlier log output from jarsigner/apksigner for the real cause","Verify all v1sign/v2sign config values (keystore path, storePass, keyAlias, keyPass)","Check that the output directory is writable and has enough disk space","Ensure signing is actually required; if you did not intend to sign, set mUseSignAPK=false so alignApks is skipped"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before running the build, ensure signing inputs are valid so signing can produce output\nif (useSignApk) {\n  if (!new File(keystorePath).isFile()) throw new IllegalStateException(\"keystore missing\");\n  if (storeAlias == null || storePass == null) throw new IllegalStateException(\"v1sign/v2sign config incomplete\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  andResGuard.build();\n} catch (IOException e) {\n  if (e.getMessage().equals(\"Can not found any signed apk file\")) {\n    throw new IllegalStateException(\"no APK was produced by signing — inspect jarsigner/apksigner errors earlier in the log\", e);\n  }\n  throw e;\n}","preventionTips":["Fix signing errors first; this error is a downstream symptom","Fail fast: abort the pipeline at the first signing warning instead of continuing","Verify the output directory is writable and not cleaned concurrently","Set mUseSignAPK=false explicitly if you do not intend to sign"],"tags":["java","signing","zipalign","apk","io"],"backgroundTag":"file-not-found","analyzedSha":"e4df245d82f27d9a2d0dd108260a3510cbaba849","analyzedAt":"2026-09-12T17:49:07.798Z","contentChangedAt":"2026-09-12T17:49:07.798Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}