零基础 Object-C 学习路线推荐 : Object-C 学习目录 >> Object-C 基础
零基础 Object-C 学习路线推荐 : Object-C 学习目录 >> Object-C 线程
零基础 Object-C 学习路线推荐 : Object-C 学习目录 >> OpenGL ES
零基础 Object-C 学习路线推荐 : Object-C 学习目录 >> GPUImage
零基础 Object-C 学习路线推荐 : Object-C 学习目录 >> AVFoundation
零基础 Object-C 学习路线推荐 : Object-C 学习目录 >> CocoaPods
一.APP崩溃提示
2021-08-07 11:55:52.705362+0800 LearnAVFoundation[10202:1163555] [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 NSLocationAlwaysUsageDescription key with a string value explaining to the user how the app uses this data
二.解决办法
需要在 info.plist 文件添加一个 NSLocationAlwaysUsageDescription的 key,然后添加一个描述。
三.小技巧
例如我们使用 PHPhotoLibrary 访问相册也会出现类似的崩溃,崩溃日志如下:
2021-08-07 11:59:31.125562+0800 LearnAVFoundation[10211:1164953] success = 0, error = Error Domain=NSCocoaErrorDomain Code=2047 "Photos Access not allowed (authorization status 0)" UserInfo={NSLocalizedDescription=Photos Access not allowed (authorization status 0)}
2021-08-07 11:59:31.128983+0800 LearnAVFoundation[10211:1164951] [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.
发现共同点没有??我们只需要根据日志,添加对应的 key / value 添加到 info.plist 即可,对于上面的崩溃问题,我们需要添加NSPhotoLibraryUsageDescription 到 info.plist 即可;
四.猜你喜欢
- Xcode – The application’s Info.plist does not contain CFBundleShortVersionString.
- Xcode – This app has attempted to access privacy-sensitive data without a usage description.
- Xcode replace 使用正则表达式替换文字
- Object-C 获取系统字体和字体名字
- Object-C 加载 TTF/OTF/TTC 文件
- Object-C private var mobileDevice文件夹
- Object-C 保存文件到相册
ChatGPT 3.5 国内中文镜像站免费使用啦
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容