iOS 10 选择本地图片时崩溃

发布时间: 2017-07-25 11:05:53 作者: 大象笔记

错误信息为

[access] This app has crashed because it attempted 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.

解决办法,Info.plist 文件中增加 NSPhotoLibraryUsageDescription 即可。需要注意,Info.plist 文件名字不是固定的,例如 Weex 中可能为 WeexDemo-Info.plist

--- a/platforms/ios/WeexDemo/WeexDemo-Info.plist
+++ b/platforms/ios/WeexDemo/WeexDemo-Info.plist
@@ -2,6 +2,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>NSPhotoLibraryUsageDescription</key>
+ <string>此 App 需要您的同意才能读取媒体资料库</string>
我是一名山东烟台的开发者,联系作者