iOS 录屏功能开始录制失败

2021-05-14  本文已影响0人  liang1030

问题:在开发录屏功能时报如下错误:

2021-05-14 10:51:51.213305+0800 ScreenRecorderDemo[3316:1068581] -[UIWindow endDisablingInterfaceAutorotationAnimated:] called on <UIWindow: 0x101406310; frame = (0 0; 375 812); gestureRecognizers = <NSArray: 0x281d55da0>; layer = <UIWindowLayer: 0x2813365a0>> without matching -beginDisablingInterfaceAutorotation. Ignoring.
2021-05-14 10:51:51.232177+0800 ScreenRecorderDemo[3316:1068736]  [ERROR] -[RPScreenRecorder startRecordingWithHandler:]_block_invoke_2:295 failed to start due to error: Error Domain=com.apple.ReplayKit.RPRecordingErrorDomain Code=-5803 "开始录制失败" UserInfo={NSLocalizedDescription=开始录制失败}

原因:使用Main.storyboard的方式作为程序的入口,并且在AppDelegate中添加了UIWindow

解决:去掉AppDelegate中添加的UIWindow,或者不使用Main.storyboard

上一篇下一篇

猜你喜欢

热点阅读