2

当我全新安装应用程序并尝试添加照片时,即使在授予权限后,图像选择器(我正在使用 QBImagePickerController)也无法加载任何相册或图像。但是如果我终止应用程序并重新启动它就可以了。它发生在 iOS 15.2 更新之后。这是在模拟器中运行时的日志。

Failed to load library: Error Domain=com.apple.photos.error Code=41011 "Unauthorized access: client does not have valid TCC authorization" UserInfo={NSLocalizedDescription=Unauthorized access: client does not have valid TCC authorization}


failed to load photo library PHPhotoLibraryMainQueueQoS with url file:///...., Error Domain=com.apple.photos.error Code=41011 "Unauthorized access: client does not have valid TCC authorization" UserInfo={NSLocalizedDescription=Unauthorized access: client does not have valid TCC authorization}

[GatekeeperXPC] Failed to open photo library file://..../data/Media/, Error Domain=com.apple.photos.error Code=41011 "Unauthorized access: client does not have valid TCC authorization" UserInfo={NSLocalizedDescription=Unauthorized access: client does not have valid TCC authorization}
4

1 回答 1

1

如果问题仍然存在,请查看以下链接:https ://developer.apple.com/forums/thread/696804

“在 iOS 15.2 版本之前我们可以在没有授权的情况下注册 PHPhotoLibrary.shared().register(self),在 iOS 15.2 中这是不可能的,你会得到一个错误。你必须请求授权(requestAuthorization(_:)) 才能注册 PHPhotoLibrary .shared().register(self)。”

于 2022-01-17T19:51:46.893 回答