{"record":{"id":"6d93bf807eb5b5d6","repo":"ComposioHQ/composio","slug":"swift-package-resolution-completed-but-betterswift","errorCode":null,"errorMessage":"Swift package resolution completed but BetterSwiftAX ${fileName} was not found.","messagePattern":"Swift package resolution completed but BetterSwiftAX (.+?) was not found\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts","lineNumber":124,"sourceCode":"\nconst patchBetterSwiftAxForCurrentSdk = async () => {\n  await $`swift package resolve`.cwd(submodulePath);\n\n  const checkoutRoot = path.join(\n    submodulePath,\n    '.build/checkouts/BetterSwiftAX/Sources/AccessibilityControl'\n  );\n  if (!(await exists(checkoutRoot))) {\n    throw new Error(\n      'Swift package resolution completed but the BetterSwiftAX AccessibilityControl checkout was not found.'\n    );\n  }\n\n  let replacementCount = 0;\n  for (const fileName of betterSwiftAxFallbackFiles) {\n    const sourcePath = path.join(checkoutRoot, fileName);\n    if (!(await exists(sourcePath))) {\n      throw new Error(\n        `Swift package resolution completed but BetterSwiftAX ${fileName} was not found.`\n      );\n    }\n\n    const source = await fs.readFile(sourcePath, 'utf8');\n    let fileReplacementCount = 0;\n    const patched = source.replace(betterSwiftAxConstantReferencePattern, constantName => {\n      fileReplacementCount += 1;\n      return betterSwiftAxConstantLiteral(constantName);\n    });\n\n    if (patched !== source) {\n      await fs.chmod(sourcePath, 0o644).catch(() => undefined);\n      await fs.writeFile(sourcePath, patched, 'utf8');\n      replacementCount += fileReplacementCount;\n    }\n  }\n","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli-local-tools/scripts/build-beeper-imessage-binaries.ts#L106-L142","documentation":"The patcher found the BetterSwiftAX checkout but one of the specific source files it rewrites (betterSwiftAxFallbackFiles list) is missing, meaning the upstream file was renamed, moved, or split in the resolved version.","triggerScenarios":"The resolved BetterSwiftAX revision no longer contains one of the fallback source files at the expected path inside Sources/AccessibilityControl.","commonSituations":"Upstream refactor renaming the file containing kAX constant fallbacks; dependency drift after an unpinned resolve.","solutions":["Pin BetterSwiftAX back to the last-known-good version in Package.resolved.","Locate where the constants moved (grep for kAX in .build/checkouts/BetterSwiftAX) and update betterSwiftAxFallbackFiles or the path logic."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for (const fileName of betterSwiftAxFallbackFiles) {\n  if (!(await exists(path.join(checkoutRoot, fileName)))) throw new Error(`missing ${fileName}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin BetterSwiftAX to the tested revision.","When bumping the dependency, diff the Sources tree for the fallback files first."],"tags":["swift-package-manager","build-script","file-not-found"],"backgroundTag":"dependency-source-file-missing","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}