Info.plist issue when delivering app for iOS


#1

Hello,

This issue happened to me once and I solved it by adding the Photo Library Usage Description variable to the config.xml and by making an Info.plist with the NSPhotoLibraryUsage. I’ve recently made a new project and I followed the same steps when adding the camera plugin but the error still persists.
My config xml:

<plugin name="cordova-plugin-camera" spec="^3.0.0">
        <variable name="CAMERA_USAGE_DESCRIPTION" value="..." />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="..." />
   </plugin>

Info.plist

<key>NSPhotoLibraryUsageDescription</key>
<string>...</string>

The error:
Missing Info.plist key - This app attempts to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data


#2

Read the current documentation of the plugin you are using. The method to add these variables changed.


#3

(Now that you found it, please post it here for future readers. Thanks)


#4

Thank you! I was indeed using the older method to add the variables. For anyone having this same issue:

<edit-config target="NSPhotoLibraryUsageDescription" file="*-Info.plist" mode="merge">
    <string>need to photo library access to get pictures from there</string>
</edit-config>

Just add this in the config.xml


#5

For anyone looking at this : another solution is to add the description text from xCode, in “Info”. That’s just another way to do the same.


#6

… which will get lost every time you recreate your Cordova app. You should really try to minimize messing with the project via Xcode.


#7

To be a little more specific on the @mateuspetter answer which worked for me:

    <platform name="ios">
        ...
        <edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
            <string>Fuelonomy would like to access your photo library for accessing photos of your cars and receipts.</string>
        </edit-config>
    </platform>