IOS 之错误记录

文章目录

      • 1、相机权限: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.
      • 2、Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window.
      • 3、'statusBarOrientation' was deprecated in iOS 13.0: Use the interfaceOrientation property of the window scene instead.
      • 4、DYLD_LIBRARY_PATH=/usr/lib/system/introspection,DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecordin
      • 5、`where` clauses are preferred over a single `if` inside a `for`. (for_where)

1、相机权限: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.

  • https://blog.csdn.net/qq_39097425/article/details/88985484
  • 在 info.plist 添加键值对 “Privacy - Camera Usage Description” —— YES(值不能为空,随便填个值就行)在这里插入图片描述

2、Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window.

  • 问题:
  • 1、iPhone 系统版本12.1.2,Xcode 13.1。运行代码显示iPhone’s iOS 12.1.2 doesn’t match Playza.app’s iOS 13.0 deployment target
  • 2、升级 iPhone 系统版本到最新版本15.3.1后,运行代码显示Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window.
  • 3、在 Xcode 中快捷键 command + shift + 2,显示Errors were encountered while preparing your device for development. Please check the Devices and Simulators Window. Failed to prepare device for development
    4、搜索网上资料,在stackoverflow网站上发现有前辈遇上到同样的问题组合(iPhone 15.3.1 + Xcode 13.1),对方将 Xcode 升级为 13.2 解决问题。但因为约定 Xcode 版本需要统一进行升级,故换了一部低于 15.3.1 版本的手机。
    Xcode error: Failed to prepare device for development

3、‘statusBarOrientation’ was deprecated in iOS 13.0: Use the interfaceOrientation property of the window scene instead.

  • 参考资料
  • 解决:
extension UIWindow {static var isLandScape: Bool {if #available(iOS 13.0, *) {return UIApplication.shared.windows.first?.windowScene?.interfaceOrientation.isLandscape ?? false} else {return UIApplication.shared.statusBarOrientation.isLandscape}}
}

4、DYLD_LIBRARY_PATH=/usr/lib/system/introspection,DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecordin

  • 报错截图:
    请添加图片描述参考资料

5、where clauses are preferred over a single if inside a for. (for_where)

参考资料


未完待续…


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部