我希望有人能帮上忙。我有这个Xcode /,每次我试图构建它时,我都会得到以下错误:
这个应用程序已经崩溃,因为它试图访问隐私敏感的数据,而没有使用说明。应用程序的Info.plist必须包含一个带有字符串值的NSPhotoLibraryAddUsageDescription键,向用户解释应用程序如何使用这些数据。
据我所知,在我的info.plist中,我需要对相机、库等的使用进行描述,但据我所见,我有吗?
这是我的info.plist:
<?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>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>MyGame</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFiles</key>
<array>
<string>AppIcon57x57.png</string>
<string>AppIcon57x57@2x.png</string>
<string>AppIcon60x60@2x.png</string>
<string>AppIcon72x72@2x~ipad.png</string>
<string>AppIcon72x72~ipad.png</string>
<string>AppIcon76x76@2x~ipad.png</string>
<string>AppIcon76x76~ipad.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>com.mycompany.${PRODUCT_NAME}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.3</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true />
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true />
</dict>
<key>UIApplicationExitsOnSuspend</key>
<false />
<key>UILaunchStoryboardName~ipad</key>
<string>LaunchScreen-iPad</string>
<key>UILaunchStoryboardName~iphone</key>
<string>LaunchScreen-iPhone</string>
<key>UILaunchStoryboardName~ipod</key>
<string>LaunchScreen-iPhone</string>
<key>UIPrerenderedIcon</key>
<false />
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true />
<key>UIRequiresPersistentWiFi</key>
<false />
<key>UIStatusBarHidden</key>
<true />
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleDefault</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>Unity_LoadingActivityIndicatorStyle</key>
<integer>-1</integer>
<key>UnityCloudProjectID</key>
<string>xxx-xxx-xxx-xxx-xxx</string>
<key>UnityCrashSubmissionURL</key>
<string>https://a:b@perf-events.cloud.unity3d.com/symbolicate</string>
<key>NSCameraUsageDescription</key>
<string>Used for profile image</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Used for profile image</string>
<key>FacebookAppID</key>
<string>xxxxx</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>facebook-unity-sdk</string>
<key>CFBundleURLSchemes</key>
<array>
<string>xxxxx</string>
</array>
</dict>
</array>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>fbapi</string>
<string>fb-messenger-api</string>
<string>fbauth2</string>
<string>fbshareextension</string>
</array>
</dict>
</plist>如你所见,我在里面有描述?!!
当查看Xcode中的info.plist时,如下所示

真希望有人能在这件事上帮我,谢谢:-)
发布于 2017-11-03 07:02:21
您需要在info.plist中添加以下代码
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Here write description why you accessing photo library</string>隐私-图片库的使用说明用于读写库,NSPhotoLibraryAddUsageDescription只用于读取。如果您的应用程序只需要阅读,添加NSPhotoLibraryAddUsageDescription
有关详细信息,请参阅此链接,ref/doc/uid/TP40009251-SW73
见以下截图:
1)右键单击Info.plist文件
->选择Open选项
->点击源代码

2)现在在这里复制和粘贴上面的代码,。

发布于 2017-10-06 08:50:51
您需要在NSPhotoLibraryAddUsageDescription 11中的info.plist文件中添加iOS。
如果要在照片库中添加照片/图像,则必须将此键添加到info.plist文件中。
发布于 2018-03-08 01:08:37
我发现你还需要
<key>NSCameraUsageDescription</key>
<string>Photo Library Access Warning</string>否则它还是会崩溃的。你现在需要这三个人-2018年3月
https://stackoverflow.com/questions/46601885
复制相似问题