Ionic 2: NSCameraUsageDescription and NSPhotoLibraryUsageDescription not written on build

When I build my app for iOS, the keys:

  • NSCameraUsageDescription
  • NSPhotoLibraryUsageDescription

are not written into the info.plist file. They are there, but blank. This causes my archive to be rejected by Apple. Why could this be happening?

The only plugin I’m using that needs camera is the standard cordova-plugin-camera, which I installed according to Ionic Native documentation.

Some relevant bits that might help:

Config.xml:

    <plugin name="cordova-plugin-camera" spec="~2.4.0">
        <variable name="CAMERA_USAGE_DESCRIPTION" value=" " />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value=" " />
    </plugin>

Ionic info:

    Cordova CLI: 6.5.0 
    Ionic Framework Version: 3.0.1
    Ionic CLI Version: 3.0.0-beta.4
    ios-deploy version: 1.9.1 
    ios-sim version: 5.0.8 
    OS: OS X El Capitan
    Node Version: v6.10.0
    Xcode version: Xcode 8.2.1 Build version 8C1002

https://ionicframework.com/docs/native/camera/?

I think the Ionic Native documentation is lacking. Check the docs of the plugin directly: https://github.com/apache/cordova-plugin-camera#ios-quirks