Unable to submit test build due to xcode 8 NSCameraUsageDescription missing key
I was able to submit my build before xcode 8 release, but now, when I archive and upload to the app store (testflight), it doesn't expose the build and sends me an email with the following content:
To process your delivery, the following issues must be corrected:
This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
The fix is quite simple, I have to write down a message saying how I'm using the device camera with NSCameraUsageDescription
in info.plist
, but the problem here is I'm not using the device camera (webcam) anywhere in my project.
I searched my project for the word Camera, they all refer to Unity's Camera. According to Unity, device camera can be used with WebCamTexture
API. No trace of this in my project.
I searched for "webcam" and found the following line in Assembly-CSharp-Editor-vs.csproj
:
<DefineConstants>DEBUG;TRACE;UNITY_5_1_1;UNITY_5_1;UNITY_5;ENABLE_NEW_BUGREPORTER;ENABLE_2D_PHYSICS;ENABLE_4_6_FEATURES;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_FRAME_DEBUGGER;ENABLE_GENERICS;ENABLE_HOME_SCREEN;ENABLE_IMAGEEFFECTS;ENABLE_LIGHT_PROBES_LEGACY;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_PHYSICS_PHYSX3;ENABLE_PLUGIN_INSPECTOR;ENABLE_SHADOWS;ENABLE_SINGLE_INSTANCE_BUILD_SETTING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_UNET;ENABLE_UNITYEVENTS;ENABLE_VR;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_LICENSE;ENABLE_AUDIOMIXER_SUSPEND;ENABLE_EDITOR_METRICS;INCLUDE_DYNAMIC_GI;INCLUDE_GI;INCLUDE_IL2CPP;INCLUDE_DIRECTX12;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;ENABLE_LOCALIZATION;UNITY_ANDROID;UNITY_ANDROID_API;ENABLE_SUBSTANCE;ENABLE_TEXTUREID_MAP;ENABLE_EGL;ENABLE_NETWORK;ENABLE_RUNTIME_GI;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_MONO;DEVELOPMENT_BUILD;ENABLE_PROFILER;DEBUG;TRACE;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_OSX;CROSS_PLATFORM_INPUT;MOBILE_INPUT;ENABLE_DUCK_TYPING</DefineConstants>
So I've created a blank project using Unity and it had a very similar entry with ENABLE_WEBCAM
too so I don't think it's caused by this. Turns out that a fresh blank project had the same problem too (just received the email).
I'm using Unity version 5.3.4f1 (About to release a game so it would take a really good reason to update) ;)
tldr;
Is NSCameraUsageDescription
now a required field since xcode 8 release or is it directly related to something I'm using in my Unity project?
Same issue here. I'm not using the camera at all. I set the info.plist value of NSCameraUsageDescription to the string "unused"
Cool, thanks for sharing, I'll do this too :)
I found a post that the issue is fixed in 5.4.1.p2. I haven't upgraded to that patch version yet https://issuetracker.unity3d.com/issues/ios-using-device-camera-on-ios-10-causes-the-application-to-be-ter$$anonymous$$ated?page=1#comments
Answer by GabLeRoux · Nov 12, 2016 at 07:06 PM
So thanks to @conjugategames, since I'm doing most of the build with the command line, here's the commands I ended up using (only works on MacOS):
/usr/libexec/PlistBuddy -c "Add :NSCameraUsageDescription string" ./Info.plist || true
/usr/libexec/PlistBuddy -c "Set :NSCameraUsageDescription 'not used'" ./Info.plist
It basically uses PlistBuddy to create the NSCameraUsageDescription
tag in the Info.plist
file (the || true
read "or true" makes the command succeed even if the key was already there). The second line sets the value to "not used".