unity发布ios报错NSCameraUsageDescription/NSPhotoLibraryUsageDescription 解决方法

unity使用ios系统相机 或者 保存相册,方法参考unity调用ios相机方法
但是发布xcode,编译运行时,在调用相机和保存相册时中断报错:“This app has crashed because it attempted 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.”
同样的保存相册时也会报错,类似 的提示添NSPhotoLibraryUsageDescription

解决办法有两个
1:按字面意思,可以解决,可以在info.plist中添加NSCameraUsageDescription和NSPhotoLibraryUsageDescription 描述
添加完后显示成
在这里插入图片描述

2:直接在unity中设置player-》other setting-〉camera usage discription 以及microphone usage discription /location usage description。随便写点啥,最后导出xcode之后就有了哪几项的描述

在这里插入图片描述

问题解决

猜你喜欢

转载自blog.csdn.net/mansir123/article/details/118371744