{"record":{"id":"0d3a60ec02c6daac","repo":"gitbutlerapp/gitbutler","slug":"could-not-find-application-for-bundle-identifier","errorCode":null,"errorMessage":"Could not find application for '{bundle_identifier}'","messagePattern":"Could not find application for '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-api/src/open/program.rs","lineNumber":608,"sourceCode":"    fn resolve_cli_wrapper_abspath(&self) -> anyhow::Result<PathBuf> {\n        let app_dir_path = self.find_app_directory()?;\n        let cli_wrapper_path = self.cli_wrapper_path.as_deref().ok_or_else(|| {\n            anyhow::anyhow!(\"No CLI wrapper configured for {}\", self.bundle_identifier)\n        })?;\n        Ok(app_dir_path.join(cli_wrapper_path))\n    }\n\n    #[cfg(target_os = \"macos\")]\n    fn find_app_directory(&self) -> anyhow::Result<PathBuf> {\n        use objc2_app_kit::NSWorkspace;\n        use objc2_foundation::NSString;\n\n        let workspace = NSWorkspace::sharedWorkspace();\n        let bundle_identifier = NSString::from_str(&self.bundle_identifier);\n        let app_url = workspace\n            .URLForApplicationWithBundleIdentifier(&bundle_identifier)\n            .ok_or_else(|| {\n                anyhow::anyhow!(\n                    \"Could not find application for '{}'\",\n                    self.bundle_identifier\n                )\n            })?;\n\n        app_url.to_file_path().ok_or_else(|| {\n            anyhow::anyhow!(\n                \"Could not resolve application path for '{}'\",\n                self.bundle_identifier\n            )\n        })\n    }\n}\n\n#[cfg(target_os = \"macos\")]\nfn open_in_macos_application(\n    app: &MacosApplication,\n    cli_arg_supplier: &CliArgumentSupplier,","sourceCodeStart":590,"sourceCodeEnd":626,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-api/src/open/program.rs#L590-L626","documentation":"MacosApplication::find_app_directory uses NSWorkspace.URLForApplicationWithBundleIdentifier to resolve an installed app's location from its bundle identifier. When LaunchServices has no application registered under that identifier, the URL is nil and the code raises 'Could not find application for {bundle_identifier}'. It means the application the registry expects is simply not installed (or not visible to LaunchServices) on this Mac.","triggerScenarios":"Calling open_in_macos_application (via resolve_cli_wrapper_abspath) with a bundle_identifier that no installed application registers — the app was never installed, was uninstalled, or is only present in a non-standard location LaunchServices doesn't know.","commonSituations":"User selected a terminal/app that isn't installed; app moved out of /Applications and LaunchServices lost it; app installed for another user or via unregistered portable copy; stale Settings entry after uninstalling the app.","solutions":["Install the application identified by that bundle identifier, or switch the configured terminal/app in Settings to one that is installed.","If installed elsewhere, re-register it with LaunchServices: `/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /path/to/App.app`.","Confirm the bundle id resolves: `mdfind 'kMDItemCFBundleIdentifier == \"<bundle_identifier>\"'`.","Launch the app once manually so macOS registers it, then retry."],"exampleFix":"// before\n# app uninstalled, settings still point to it\nmdfind 'kMDItemCFBundleIdentifier == \"com.apple.Terminal\"' // no result\n// after\n# reinstall or pick an installed app; verify:\nmdfind 'kMDItemCFBundleIdentifier == \"com.apple.Terminal\"' // /System/Applications/Utilities/Terminal.app","handlingStrategy":"validation","validationCode":"# verify the bundle id resolves before invoking\nmdfind \"kMDItemCFBundleIdentifier == 'com.wez.wezterm'\" | grep -q . && echo installed || echo 'app not installed'","typeGuard":null,"tryCatchPattern":"try {\n  await openInMacosApplication(bundleId, path);\n} catch (e) {\n  if (String(e).startsWith('Could not find application for')) {\n    showToast(`${bundleId} is not installed. Install it or pick another terminal in Settings.`);\n  } else throw e;\n}","preventionTips":["Offer only apps that mdfind/NSWorkspace confirms are installed.","Refresh the availability list when Settings opens.","If the app is installed outside /Applications, register it with lsregister so LaunchServices can find it."],"tags":["macos","launchservices","app-not-installed","bundle-identifier"],"backgroundTag":"resource-not-found","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}