Skip to content

App fails to launch: resource bundle not found at expected path #271

@in0vik

Description

@in0vik

Description

CodexBar fails to launch with a fatal error because the resource bundle accessor looks for CodexBar_CodexBar.bundle in the wrong location.

Error Message

CodexBar/resource_bundle_accessor.swift:12: Fatal error: could not load resource bundle: from /Applications/CodexBar.app/CodexBar_CodexBar.bundle or /Users/steipete/Projects/codexbar/.build/arm64-apple-macosx/release/CodexBar_CodexBar.bundle

Root Cause

The Swift Package Manager-generated resource_bundle_accessor.swift searches for the bundle in:

  1. /Applications/CodexBar.app/CodexBar_CodexBar.bundle (app root - incorrect for macOS app bundle)
  2. /Users/steipete/Projects/codexbar/.build/... (developer's build path)

However, the bundle is correctly placed at:
/Applications/CodexBar.app/Contents/Resources/CodexBar_CodexBar.bundle

This is the standard location for resources in a macOS app bundle.

Workaround

Creating a symlink resolves the issue:

ln -s Contents/Resources/CodexBar_CodexBar.bundle /Applications/CodexBar.app/CodexBar_CodexBar.bundle

Suggested Fix

The bundle copy phase in the build process should either:

  1. Place the bundle in the app root alongside the Contents folder, or
  2. Override the SPM-generated resource accessor to look in Contents/Resources/

Environment

  • macOS version: Darwin 24.6.0
  • CodexBar version: 0.18.0-beta.2 (build 50)
  • Git commit: 6a6b598

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions