Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity3D ReplayKit not working with IOS 15.1 and Xcode 13

Discussion in 'iOS and tvOS' started by TTharun, Nov 30, 2021.

  1. TTharun

    TTharun

    Joined:
    Aug 11, 2017
    Posts:
    2
    Hi,

    I have recently updated the XCODE to latest version. Now the iOS ReplayKit started showing errors when running in IOS device.

    Unity3D 2020.1.9 - iOS
    iOS 15.1
    macOS Monterey
    Xcode 13.1

    https://docs.unity3d.com/ScriptReference/Apple.ReplayKit.ReplayKit.html

    Below are two different errors. In previous Xcode versions it all used to work fine.

    2021-12-01 00:24:37.779170+0530 replaykit[527:112902] *** Assertion failure in +[UnityReplayKit sharedInstance], UnityReplayKit.mm:129

    2021-12-01 00:24:37.798100+0530 replaykit[527:112902] Uncaught exception: NSInternalInconsistencyException: InitUnityReplayKit should be called before using ReplayKit api.

    (

    0 CoreFoundation 0x000000018490a060 B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 626784

    1 libobjc.A.dylib 0x000000019cf7ef54 objc_exception_throw + 60

    2 Foundation 0x00000001861c36cc D59C6975-5AF2-37BC-93BE-43B80B4293A5 + 1246924

    3 UnityFramework 0x0000000105676f34 +[UnityReplayKit sharedInstance] + 124

    4 UnityFramework 0x0000000105678c58 UnityReplayKitIsRecording + 32

    5 UnityFramework 0x0000000105a4ebe8 _Z36ReplayKit_Get_Custom_PropIsRecordingv + 12

    6 UnityFramework 0x0000000105d6d75c Replay_Update_mD9ED2E5C9B35498D82CB182241E140526779A681 + 24

    7 UnityFramework 0x00000001056c27a0 _Z65RuntimeInvoker_TrueVoid_t700C6383A2A510C2CF4DD86DABD5CA9FF70ADAC5PFvvEPK10MethodInfoPvPS4_ + 20

    8 UnityFramework 0x0000000105d54f64 _ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP15Il2CppException + 116

    9 UnityFramework 0x00000001059dd5bc _Z23scripting_method_invoke18ScriptingMethodPtr18ScriptingObjectPtrR18ScriptingArgumentsP21ScriptingExceptionPtrb + 124

    10 UnityFramework 0x00000001059e7f10 _ZN19ScriptingInvocation6InvokeEP21ScriptingExceptionPtrb + 120

    11 UnityFramework 0x00000001059f3850 _ZN13MonoBehaviour16CallUpdateMethodEi + 272

    12 UnityFramework 0x00000001058adcec _ZN20BaseBehaviourManager12CommonUpdateI16BehaviourManagerEEvv + 228

    13 UnityFramework 0x0000000105932c90 _Z17ExecutePlayerLoopP22NativePlayerLoopSystem + 88

    14 UnityFramework 0x0000000105932cc4 _Z17ExecutePlayerLoopP22NativePlayerLoopSystem + 140

    15 UnityFramework 0x0000000105932f1c _Z10PlayerLoopv + 344

    16 UnityFramework 0x0000000105b79318 _ZL19UnityPlayerLoopImplb + 240

    17 UnityFramework 0x00000001056870e0 UnityRepaint + 140

    18 UnityFramework 0x00000001056798f4 -[UnityAppController(ViewHandling) showGameUI] + 240

    19 UnityFramework 0x00000001056816ec -[UnityAppController startUnity:] + 124

    20 Foundation 0x00000001860c956c __NSFireDelayedPerform + 460

    21 CoreFoundation 0x000000018491f268 B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 713320

    22 CoreFoundation 0x00000001848a3c40 B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 207936

    23 CoreFoundation 0x000000018489e43c B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 185404

    24 CoreFoundation 0x000000018487cc58 B2D21CFD-378C-36D5-BAF7-3F70599CFEFC + 48216

    25 CoreFoundation 0x00000001848903b8 CFRunLoopRunSpecific + 600

    26 GraphicsServices 0x00000001a022038c GSEventRunModal + 164

    27 UIKitCore 0x00000001872306a8 8388EB03-002B-3B35-A78A-6A022894292E + 5346984

    28 UIKitCore 0x0000000186faf7f4 UIApplicationMain + 2092

    29 UnityFramework 0x0000000105686a80 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 108

    30 replaykit 0x0000000100e7fe1c main + 68

    31 dyld 0x0000000100f0da24 start + 520

    )

    2021-12-01 00:24:37.799276+0530 replaykit[527:112902] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'InitUnityReplayKit should be called before using ReplayKit api.'

    *** First throw call stack:

    (0x18490a04c 0x19cf7ef54 0x1861c36cc 0x105676f34 0x105678c58 0x105a4ebe8 0x105d6d75c 0x1056c27a0 0x105d54f64 0x1059dd5bc 0x1059e7f10 0x1059f3850 0x1058adcec 0x105932c90 0x105932cc4 0x105932f1c 0x105b79318 0x1056870e0 0x1056798f4 0x1056816ec 0x1860c956c 0x18491f268 0x1848a3c40 0x18489e43c 0x18487cc58 0x1848903b8 0x1a022038c 0x1872306a8 0x186faf7f4 0x105686a80 0x100e7fe1c 0x100f0da24)

    libc++abi: terminating with uncaught exception of type NSException

    dyld4 config: DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib

    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'InitUnityReplayKit should be called before using ReplayKit api.'

    terminating with uncaught exception of type NSException



    -> applicationWillResignActive()

    -> applicationDidBecomeActive()

    ReplayKit.isRecording = STOPTrue

    Replay:stopRecording()

    UnityEngine.Events.UnityAction:Invoke()

    UnityEngine.Events.UnityEvent:Invoke()

    UnityEngine.EventSystems.EventFunction`1:Invoke(T1, BaseEventData)

    UnityEngine.EventSystems.ExecuteEvents:Execute(GameObject, BaseEventData, EventFunction`1)

    UnityEngine.EventSystems.StandaloneInputModule:processTouchPress(PointerEventData, Boolean, Boolean)

    UnityEngine.EventSystems.StandaloneInputModule:processTouchEvents()

    UnityEngine.EventSystems.StandaloneInputModule:process()


    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)


    2021-12-01 00:19:07.416047+0530 replaykit[512:109438] [NSExtension] Extension request contains input items but the extension point does not specify a set of allowed payload classes. The extension point's NSExtensionContext subclass must implement `+_allowedItemPayloadClasses`. This must return the set of allowed NSExtensionItem payload classes. In future, this request will fail with an error. Extension: <EXConcreteExtension: 0x2819821c0> {id = com.apple.ReplayKit.RPVideoEditorExtension} Items: (

    "<NSExtensionItem: 0x282eacde0> - userInfo: {\n NSExtensionItemAttachmentsKey = (\n \"<NSItemProvider: 0x2807ad110> {types = (\\n \\\"public.data\\\"\\n)}\"\n );\n NSExtensionItemAttributedTitleKey = {length = 343, bytes = 0x7b5c7274 66315c61 6e73695c 616e7369 ... 4e616d65 4b65797d };\n}",

    "<NSExtensionItem: 0x282ea1690> - userInfo: {\n NSExtensionItemAttachmentsKey = (\n \"<NSItemProvider: 0x2807ad180> {types = (\\n \\\"public.data\\\"\\n)}\"\n );\n NSExtensionItemAttributedTitleKey = {length = 344, bytes = 0x7b5c7274 66315c61 6e73695c 616e7369 ... 6555524c 4b65797d };\n}",

    "<NSExtensionItem: 0x282ea15d0> - userInfo: {\n NSExtensionItemAttachmentsKey = (\n \"<NSItemProvider: 0x2807acc40> {types = (\\n \\\"public.data\\\"\\n)}\"\n );\n NSExtensionItemAttributedTitleKey = {length = 352, bytes = 0x7b5c7274 66315c61 6e73695c 616e7369 ... 66696572 4b65797d };\n}"

    )
     
    Nolex and jgmakes like this.
  2. Burn0815

    Burn0815

    Joined:
    Jul 3, 2019
    Posts:
    10
    Hi, did you found a solution for this?
     
    Nolex and jgmakes like this.
  3. jgmakes

    jgmakes

    Joined:
    Jan 10, 2019
    Posts:
    75
    Same with:

    Unity 2019.4.16
    Xcode 13.3
    iOS 15.3.1

    This seems like something to elevate to the Unity team...?
     
    Nolex likes this.
  4. Voxel-Busters

    Voxel-Busters

    Joined:
    Feb 25, 2015
    Posts:
    1,832
    We have a custom implementation of replaykit on iOS which don't use the unity's api.
    Give a try with Cross Platform Replay Kit which is free for iOS (atleast until unity fixes it if you are in rush).

    If you have any issues, do let us know. It has lots of other features like recorded video path access and sharing.
     
  5. Nolex

    Nolex

    Joined:
    Dec 10, 2010
    Posts:
    115
    @TTharun @Burn0815 @jgmakes

    I had the same problem but I found a solution.
    The problem occurs if you initialize the ReplayKit (use ReplayKit.APIAvailable etc...) at the start of the game. If you initialize a little later, then everything works.

    Unity 2019.4.36f
    Xcode 13.2.1