ReplayKit stopRecording: does not always call its completion handler

I'm using ReplayKit to record the screen during an ARKit scene (not sure if that makes a difference). If I start a recording and then stop it, sometimes the completion handler is not called for stopRecording. This means that I never get a previewController to show the user, so the recording is lost. I don't see any error messages and the didStopRecordingWith previewViewController function is not called either.


Anyone else getting this problem? Any suggestions on how to prevent it?

Replies

It would be nice if Apple would reply or fix this. This seems like a widespread issue, and apps that rely on ReplayKit are completely broken when the stop handler isn't called...

I have the same problem...

i have the same issue in iOS 11😟.

Apple should fix this issue😎.


For now Restarting the device make it work fine 😕.

I'm having the same issue in iPad WiFi 2017 iOS 11.0.3 and 11.1 beta 5. It only happens sometimes, and only first time the app is opened. To reproduce this issue, just follow these steps:


  1. Open the app that implements ReplayKit
  2. Start a new recording
  3. Stop recording
  4. If completion handler is called, then it worked. To try to reproduce the issue again, just close the app swiping it away, and back to step 1.


Sometimes it happens on first try, but sometimes it requires several times to reproduce the issue.

I tried restarting the device, installing iOS 11 beta 5, and performing a factory reset. It keeps failing. I'm not using ArKit.

It's very annoying because we are almost ready to release our new app, but this issue is stopping us. Is there any way to fix it?


EDIT: Each time it happens, a crash report is generated in device log. Here is one of them: https://pastebin.com/raw/GF4EAje5

Has this bug been sent to Apple? Does anyone know of a URL for the reported bug?

It's been reported multiple times to Apple. They marked mine as a duplicate then they closed it claiming it's fixed in 11.2. However, it is not fixed in 11.2.

+1 this one is not fixed in 11.2.1

The quickest way to drive it:


- use iOS 11 system screen recorder, then stop it

- start your app's screen recording, try to stop it


stopRecordingWithHandler never gets called back nor do the delegate methods. Not only that but the screen's "isCaptured" is set to TRUE, which we use to show an on-screen indicator that it's recording. This makes our users think recording is always happening.


If you don't use iOS 11's screen recording it seems to work fine.

I get the same behaviour from the Simulator. It's strange, because if ReplayKit wasn't available, isAvailable should return false...

Also, recording was working on my iPadPro and after a while, it stopped working. I suspect it's because from a UITest I declined recording once. But startRecording is not returning any errors... So quite clueless as to how to have it working again.

Here's a tutorial on how to record video and audio WITHOUT ReplayKit. The code is opensource - it works from the ARKit ARSCNView Snapshot - works for anything thats in your sceneview.


https://medium.com/ar-tips-and-tricks/arkit-how-to-make-your-own-audio-video-recorder-3d72016d1087?fbclid=IwAR2SiKIRxt3np5Wnn-Vi90XheEsGksSO5j0kj-N9emmQoFIoL80aqRGxndY

+1 this one is not fixed in 12