Unexpected bundle class 16 declaring type public.gpx

I have a minimal macOS document based app written in SwiftUI in Xcode 16.3. It is created from the standard template replacing all occurences of 'com.example.plain-text' with 'com.topografix.gpx' and changing the file extension in info.plist from 'exampletext' to 'gpx'.

Those changes are sufficient to allow opening, editing and saving of .gpx files.

However, when opening, editing or saving, the following message is written to the console 6 times.

Unexpected bundle class 16 declaring type public.gpx

While this is not preventing the app from working, I would like to understand the origin of the message and fix the underlying problem.

Answered by DTS Engineer in 851943022

This log message is coming out of Launch Services, the macOS subsystem that keeps track of, amongst other things, what apps are installed on the system. Internally LS tracks the type, aka class, of each bundle it tracks. For example, 2 is an app and 12 is an XPC service. 16 is used as a placeholder value.

You’ll see these values when you dump the LS database. For example, on my Mac I saw this:

% alias lsregister=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister
% lsregister -dump
…
bundle id:                  Developer (0xa4c4)
class:                      kLSBundleClassRemotePlaceholder (0x10)
container:                  / (0x4)
mount state:                mounted
Device Family:              1, 2
sequenceNum:                42180
path:                       …/Developer.app (0xf2d0)
…

Note that 0x10 is 16.

I believe that this specific bundle record is for the iOS Developer app, as opposed to the Mac native Developer app, but AFAIK these placeholders are not used exclusively for that.

IMPORTANT This stuff is all implementation detail, so not something you should depend on in your code.

The logic for handling this is complex, more complex than I understand and more complex that I’m prepared to research in the context of DevForums. And given that everything is otherwise working fine, I’m gonna recommend you think of this as log noise and move on with your day.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

This log message is coming out of Launch Services, the macOS subsystem that keeps track of, amongst other things, what apps are installed on the system. Internally LS tracks the type, aka class, of each bundle it tracks. For example, 2 is an app and 12 is an XPC service. 16 is used as a placeholder value.

You’ll see these values when you dump the LS database. For example, on my Mac I saw this:

% alias lsregister=/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister
% lsregister -dump
…
bundle id:                  Developer (0xa4c4)
class:                      kLSBundleClassRemotePlaceholder (0x10)
container:                  / (0x4)
mount state:                mounted
Device Family:              1, 2
sequenceNum:                42180
path:                       …/Developer.app (0xf2d0)
…

Note that 0x10 is 16.

I believe that this specific bundle record is for the iOS Developer app, as opposed to the Mac native Developer app, but AFAIK these placeholders are not used exclusively for that.

IMPORTANT This stuff is all implementation detail, so not something you should depend on in your code.

The logic for handling this is complex, more complex than I understand and more complex that I’m prepared to research in the context of DevForums. And given that everything is otherwise working fine, I’m gonna recommend you think of this as log noise and move on with your day.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Unexpected bundle class 16 declaring type public.gpx
 
 
Q