Settings.bundle - plist: The data couldn’t be read because it isn’t in the correct format

1.1k views Asked by At

I've used a script in Xcode 8 / iOS 10 to generate an acknowledge section in the settings bundle.

The script producing an Acknowledgements.plist file that gives the error message

The data couldn’t be read because it isn’t in the correct format.

when I try to open it in Xcode. When I open Acknowledgements.plist file with textEdit it looks OK on first sight ...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>knobcontrol</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
<key>FooterText</key>
<string>knobcontrol2</string>
</array>
<key>StringsTable</key>
<string>Acknowledgements</string>
</dict>
</plist>

I've tried some of the comments according to the script but could not find what is wrong with the plist - can anybody have a look at the file? I don't have enough reputation to post comments to the script posting.

1

There are 1 answers

0
shallowThought On BEST ANSWER

You are using <key>...</key> value pairs within an <array>.

Make it a <dict> instead:

...
<plist version="1.0">
    <dict>
        <key>PreferenceSpecifiers</key>
        <dict>    <- dict, not array
            ...
        </dict>    <- dict, not array
        <key>StringsTable</key>
        <string>Acknowledgements</string>
    </dict>
</plist>