Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

SimplyCoreAudio() crashes on instantiation in command-line executable due to no bundleIdentifier #49

@jolonf

Description

@jolonf

A command-line executable will crash when instantiating SimplyCoreAudio() due to unwrapping nil on the bundleIdentifier here:

private lazy var queueLabel = Bundle.main.bundleIdentifier!.appending(".audioObjectPool")

This is because by default command line executables don't have an embedded Info.plist. This can be fixed by setting the Create Info.plist Section in Library option in Build Settings -> Packaging to Yes.

However, when creating a Swift executable from the command line using SwiftPM, there doesn't appear to be a way to invoke that setting.

A possible solution from SimplyCoreAudio would be to provide an alternate static string if the bundleIdentifier is nil.

Alternatively, do you know if there is a way to set the CREATE_INFOPLIST_SECTION_IN_BINARY option for swift build?

This isn't critical, I was just creating a simple test from the command line. But is useful for sharing simple examples.

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