iosplistios-camera

error: unable to read property list from file: /Info.plist: The operation couldn’t be completed


I am trying to build my react native app in Xcode but I keep getting this error. I know this means my plist is probably configured improperly, but it is next to impossible to find the proper syntax or documentation for these files. I have added 5 things to the default plist that gets generated when running npx react-native init <app-name>. They look as follows...

    <key>NSCameraUsageDescription</key>
    <string>Enable Kidz-n-Motion access to your camera</string>

    <key>NSPhotoLibraryAddUsageDescription</key>
    <string>Enable Kidz-n-Motion access to add to your Photos</string>

    <key>NSPhotoLibraryUsageDescription</key>
    <string>Enable Kidz-n-Motion access to your Camera Roll</string>

    <key>NSMicrophoneUsageDescription</key>
    <string>Enable Kidz-n-Motion access to your microphone during recording<string>

    <key>UIAppFonts</key>
    <array>
        <string>Gilroy-Black.ttf</string>
        <string>Gilroy-Bold.ttf</string>
        <string>Gilroy-ExtraBold.ttf</string>
        <string>Gilroy-Heavy.ttf</string>
        <string>Gilroy-Light.ttf</string>
        <string>Gilroy-Medium.ttf</string>
        <string>Gilroy-Regular.ttf</string>
        <string>Gilroy-SemiBold.ttf</string>
        <string>Gilroy-Thin.ttf</string>
        <string>Gilroy-UltraLight.ttf</string>
        <string>Lato-Bold.ttf</string>
        <string>Lato-Medium.ttf</string>
        <string>Lato-Regular.ttf</string>
        <string>Lato-Semibold.ttf</string>
        <string>LeagueSpartan-Bold.ttf</string>
        <string>LeagueSpartan-Medium.ttf</string>
        <string>LeagueSpartan-Regular.ttf</string>
        <string>LeagueSpartan-SemiBold.ttf</string>
        <string>Spartan-Black.ttf</string>
        <string>Spartan-Bold.ttf</string>
        <string>Spartan-ExtraBold.ttf</string>
        <string>Spartan-ExtraLight.ttf</string>
        <string>Spartan-Light.ttf</string>
        <string>Spartan-Medium.ttf</string>
        <string>Spartan-Regular.ttf</string>
        <string>Spartan-SemiBold.ttf</string>
        <string>Spartan-Thin.ttf</string>
    </array>

I'm nearly positive the UIFonts are proper, I've built the app with the in the3 plist before, meaning its almost certainly the Camera/Mic permissions, however I copied those off of their respective documentation, so I'm not sure what the fix here would be


Solution

  • This ended up being two typo's that I must have fat-fingered in somehow while copying.

        <key>NSCameraUsageDescription</key>
        <string>Enable Kidz-n-Motion access to your camera</string>
    
        <key>NSPhotoLibraryAddUsageDescription</key>
        <string>Enable Kidz-n-Motion access to add to your Photos</string>
    
        <key>NSPhotoLibraryUsageDescription</key>
        <string>Enable Kidz-n-Motion access to your Camera Roll</string>
    
        <key>NSMicrophoneUsageDescription</key>
        <string>Enable Kidz-n-Motion access to your microphone during recording<string> //needs to be </string>
    

    You can more precisely see what's screwing with your plist if you attempt to open the Info file inside of your Xcode workspace You can find that option here... enter image description here

    If it opens up, your plist is configured properly. If it does not open, it will report back which line is breaking