{"record":{"id":"3da756239ab01fc7","repo":"shwenzhang/AndResGuard","slug":"can-not-found-the-signed-apk-file-to-repackage-path-s","errorCode":null,"errorMessage":"can not found the signed apk file to repackage, path=%s","messagePattern":"can not found the signed apk file to repackage, path=(.+?)","errorType":"exception","errorClass":"java.io.IOException","httpStatus":null,"severity":"error","filePath":"AndResGuard-core/src/main/java/com/tencent/mm/androlib/ResourceRepackage.java","lineNumber":59,"sourceCode":"  }\n\n  private void deleteUnusedFiles() {\n    //删除目录\n    FileOperation.deleteDir(m7zipOutPutDir);\n    FileOperation.deleteDir(mStoredOutPutDir);\n    if (mSignedWith7ZipApk.exists()) {\n      mSignedWith7ZipApk.delete();\n    }\n  }\n\n  /**\n   * 这边有点不太一样，就是当输出目录存在的时候是不会强制删除目录的\n   *\n   * @throws IOException\n   */\n  private void insureFileName() throws IOException {\n    if (!mSignedApk.exists()) {\n      throw new IOException(String.format(\"can not found the signed apk file to repackage\" + \", path=%s\",\n          mSignedApk.getAbsolutePath()\n      ));\n    }\n    //需要自己安装7zip\n    String apkBasename = mSignedApk.getName();\n    mApkName = apkBasename.substring(0, apkBasename.indexOf(\".apk\"));\n    //如果外面设过，就不用设了\n    if (mOutDir == null) {\n      mOutDir = new File(mSignedApk.getAbsoluteFile().getParent(), mApkName);\n    }\n\n    mSignedWith7ZipApk = new File(mOutDir.getAbsolutePath(), mApkName + \"_channel_7zip.apk\");\n    mAlignedWith7ZipApk = new File(mOutDir.getAbsolutePath(), mApkName + \"_channel_7zip_aligned.apk\");\n\n    m7zipOutPutDir = new File(mOutDir.getAbsolutePath(), TypedValue.OUT_7ZIP_FILE_PATH);\n    mStoredOutPutDir = new File(mOutDir.getAbsolutePath(), \"storefiles\");\n    //删除目录,因为之前的方法是把整个输出目录都删除，所以不会有问题，现在不会，所以要单独删\n    FileOperation.deleteDir(m7zipOutPutDir);","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/shwenzhang/AndResGuard/blob/e4df245d82f27d9a2d0dd108260a3510cbaba849/AndResGuard-core/src/main/java/com/tencent/mm/androlib/ResourceRepackage.java#L41-L77","documentation":"Validation guard in ResourceRepackage.insureFileName (part of repackageApk): the signed APK that the 7z repackage step operates on (mSignedApk, e.g. output.apk in the out dir) does not exist. The 7-Zip repackaging pipeline rewrites the already-signed APK, so without it there is nothing to repackage — typically the sign step was skipped, failed, or wrote elsewhere.","triggerScenarios":"Thrown at AndResGuard-core/src/main/java/com/tencent/mm/androlib/ResourceRepackage.java:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the signing step ran and produced the signed apk at the expected path before repackaging with 7z","Check that the output directory configuration points to where the signed apk was actually written; stale or wrong mOutDir settings commonly cause this","Regenerate the signed apk by re-running the build/sign phase"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}