0

I've received the following rejection of a SwiftUI MacOS app:

"We discovered one or more bugs in your app when reviewed on Mac running macOS 13.2.1. We received the attached error message at launch."

The full message is:

The open file operation failed to connect to the open and save panel service.

with the attached screenshot:

enter image description here

I've never seen this message before, and I've no idea how to reproduce it.

Per Technical Q&A QA1778, How to reproduce bugs reported against Mac App Store submissions, I've exported the archived app and run on a guest account on macOS 13.2.1, but it runs and can open files as expected.

I've tried opening a file on an external drive, and on iCloud Drive (successfully).

If it helps, it's a SwiftUI DocumentGroup viewing app.

Has anybody seen this message before, or has any idea how I could reproduce it?


Additional info

I'm building with Xcode 14.2 with a minimum deployment target of macOS 13.1, on an M1 Max running 13.2.1.

According to the rejection, the reviewer was running on macOS 13.2.1.


The app is a viewer of .xcdatamodel files, and its info.plist contains the following document type:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFile</key>
        <string></string>
        <key>CFBundleTypeIconSystemGenerated</key>
        <integer>1</integer>
        <key>CFBundleTypeName</key>
        <string>Core Data Model</string>
        <key>CFBundleTypeRole</key>
        <string>Viewer</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>com.apple.xcode.model.data</string>
        </array>
    </dict>
</array>
Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
  • Could you please include your Xcode version, minimum deployement target, and chip version? As I have seen [here](https://stackoverflow.com/questions/69732338/python-idle-cannot-open-file-says-the-open-file-operation-failed-to-connect-to), this could be an issue with an M1 or M2 chip. I haven't necessarily seen this message before, but it seems as though this may be an issue with OpenPanel, not your app. Maybe the App Store review is running some different software or on a different device? –  Feb 28 '23 at 21:15
  • Thanks - I updated my question. From the info I have they're running the same OS version. – Ashley Mills Feb 28 '23 at 21:57

1 Answers1

0

I asked the same question on the Apple developer forums, and received an excellent response form Julia Brockovich

Her suggestion was to try and replicate the issue on a Mac without Xcode installed, and this did indeed show the problem.

To resolve the bug I added the following to the Imported Type Identifiers:

<key>UTImportedTypeDeclarations</key>
<array>
    <dict>
        <key>UTTypeDescription</key>
        <string>Core Data Model</string>
        <key>UTTypeIcons</key>
        <dict/>
        <key>UTTypeIdentifier</key>
        <string>com.apple.xcode.model.data</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>xcdatamodel</string>
            </array>
        </dict>
    </dict>
</array>

This fixed the error message, but the app was still unable to open .xcdatamodel files, as these are recognised as packages when Xcode is installed, but just folders without.

To fix this I added an Exported Type Identifier:

<array>
    <dict>
        <key>UTTypeConformsTo</key>
        <array>
            <string>com.apple.xcode.model.data</string>
            <string>com.apple.package</string>
        </array>
        <key>UTTypeDescription</key>
        <string>Core Data Model</string>
        <key>UTTypeIcons</key>
        <dict/>
        <key>UTTypeIdentifier</key>
        <string>uk.co.joylordsystems.xcode.model.data</string>
        <key>UTTypeTagSpecification</key>
        <dict>
            <key>public.filename-extension</key>
            <array>
                <string>xcdatamodel</string>
            </array>
        </dict>
    </dict>
</array>

Full developer forum thread can be found here.

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160