AR Kit image detection problem on App relaunch

Hi code Crew,

I’m seeking help with debugging my AR app I’m stuck for 3 months now :confused:

App: it allows a user to upload an image, upload a video and when the camera detects the uploaded image in the real world, it plays the video over the physical image. Almost like in Harry Potter :wink:

Problem: On a launch, everything works fine. When I kill and relaunch the app, the camera detects black squares and videos are not playing. But if I upload a new video, then everything is working again. Here in action:

I use AR Kit on Xcode and Realm for persisting the data.
Source code here:

I’ll be thankful for eternity if someone can help