'Why so many debug error using ARKit and RealityKit?

On my project I simply wrapped a ARView, setup a configuration and run it on my real device, when I start the app Xcode print out the following error debug message.

2021-10-08 17:59:06.476537+0800 RealityKit_Shell[8247:2500396] Metal GPU Frame Capture Enabled
2021-10-08 17:59:06.476699+0800 RealityKit_Shell[8247:2500396] Metal API Validation Enabled
2021-10-08 17:59:07.219091+0800 RealityKit_Shell[8247:2500396] [AssetTypes] Registering library (/System/Library/PrivateFrameworks/CoreRE.framework/default.metallib) that already exists in shader manager. Library will be overwritten.
2021-10-08 17:59:07.374894+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/suFeatheringCreateMergedOcclusionMask.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.395024+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arKitPassthrough.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.395929+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/drPostAndComposition.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.396642+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arSegmentationComposite.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.397378+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute0.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.398275+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute1.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.398553+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute2.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.409981+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute3.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.410269+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute4.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.410527+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute5.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.410791+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute6.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.411055+0800 RealityKit_Shell[8247:2500396] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute7.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2021-10-08 17:59:07.411755+0800 RealityKit_Shell[8247:2500396] [Foundation.Serialization] Json Parse Error line 18: Json Deserialization; unknown member 'EnableARProbes' - skipping.
2021-10-08 17:59:07.411781+0800 RealityKit_Shell[8247:2500396] [Foundation.Serialization] Json Parse Error line 20: Json Deserialization; unknown member 'EnableGuidedFilterOcclusion' - skipping.
2021-10-08 17:59:07.542203+0800 RealityKit_Shell[8247:2500396] throwing -10878
2021-10-08 17:59:07.543025+0800 RealityKit_Shell[8247:2500396] throwing -10878
2021-10-08 17:59:07.543069+0800 RealityKit_Shell[8247:2500396] throwing -10878
2021-10-08 17:59:07.543108+0800 RealityKit_Shell[8247:2500396] throwing -10878
2021-10-08 17:59:07.543155+0800 RealityKit_Shell[8247:2500396] throwing -10878
2021-10-08 17:59:07.543307+0800 RealityKit_Shell[8247:2500396] throwing -10878
2021-10-08 17:59:07.543690+0800 RealityKit_Shell[8247:2500396] throwing -10878
2021-10-08 17:59:07.543802+0800 RealityKit_Shell[8247:2500396] throwing -10878
2021-10-08 17:59:07.543918+0800 RealityKit_Shell[8247:2500396] throwing -10878
2021-10-08 17:59:07.880459+0800 RealityKit_Shell[8247:2500606] [espresso] Warning: padding deconvolution PersonSeg/decoder/deconv_64/conv2d_transpose:0 in SAME mode will not be pad-invariant for all resolutions
2021-10-08 17:59:07.880514+0800 RealityKit_Shell[8247:2500606] [espresso] Warning: padding deconvolution PersonSeg/decoder/deconv_32/conv2d_transpose:0 in SAME mode will not be pad-invariant for all resolutions
2021-10-08 17:59:07.880530+0800 RealityKit_Shell[8247:2500606] [espresso] Warning: padding deconvolution PersonSeg/decoder/deconv_16/conv2d_transpose:0 in SAME mode will not be pad-invariant for all resolutions
2021-10-08 17:59:07.880546+0800 RealityKit_Shell[8247:2500606] [espresso] Warning: padding deconvolution PersonSeg/decoder/deconv_8/conv2d_transpose:0 in SAME mode will not be pad-invariant for all resolutions
2021-10-08 17:59:07.880559+0800 RealityKit_Shell[8247:2500606] [espresso] Warning: padding deconvolution PersonSeg/decoder/deconv_4/conv2d_transpose:0 in SAME mode will not be pad-invariant for all resolutions
2021-10-08 17:59:07.880572+0800 RealityKit_Shell[8247:2500606] [espresso] Warning: padding deconvolution PersonSeg/decoder/deconv_2/conv2d_transpose:0 in SAME mode will not be pad-invariant for all resolutions
2021-10-08 17:59:08.396967+0800 RealityKit_Shell[8247:2500615] [Session] ARSession <0x133d75bd0>: ARSessionDelegate is retaining 11 ARFrames. This can lead to future camera frames being dropped.
2021-10-08 17:59:08.410508+0800 RealityKit_Shell[8247:2500613] [Session] ARSession <0x133d75bd0>: ARSessionDelegate is retaining 12 ARFrames. This can lead to future camera frames being dropped.
2021-10-08 17:59:08.425793+0800 RealityKit_Shell[8247:2500615] [Session] ARSession <0x133d75bd0>: ARSessionDelegate is retaining 13 ARFrames. This can lead to future camera frames being dropped.
2021-10-08 17:59:08.443037+0800 RealityKit_Shell[8247:2500711] [Session] ARSession <0x133d75bd0>: ARSessionDelegate is retaining 14 ARFrames. This can lead to future camera frames being dropped.
2021-10-08 17:59:08.460984+0800 RealityKit_Shell[8247:2500613] [Session] ARSession <0x133d75bd0>: ARSessionDelegate is retaining 15 ARFrames. This can lead to future camera frames being dropped.
add ancora 
2021-10-08 17:59:08.520791+0800 RealityKit_Shell[8247:2500613] [Technique] ARWorldTrackingTechnique <0x138ae1710>: World tracking performance is being affected by resource constraints [2]

here below my simply code

struct ARViewWrapped: UIViewRepresentable {
    let arManager: ARManager
     
    func makeUIView(context: Context) -> some UIView {
        arManager.setupARView()
        
        return arManager.arView
    }
    
    func updateUIView(_ uiView: UIViewType, context: Context) {
        
    }
}

My manager class:


class ARManager: NSObject, ARSessionDelegate, ObservableObject {
    static var shared = ARManager()
    
    var arView = ARView(frame: .zero, cameraMode: .ar, 
                   automaticallyConfigureSession: false)
    
    func setupARView() {
        let configuration = ARWorldTrackingConfiguration()
        configuration.planeDetection = [.vertical]
        configuration.environmentTexturing = .automatic
        configuration.isAutoFocusEnabled = true
        if type(of: configuration).supportsFrameSemantics(.sceneDepth) {
            configuration.frameSemantics = .personSegmentationWithDepth
        }
        arView.debugOptions = []
        arView.session.delegate = self
        
        arView.session.run(configuration, options: .resetTracking)
    }

    func session(_ session: ARSession, didAdd anchors: [ARAnchor]) {
        print("add ancora")
    }
}

The AR experience start correctly, but just I would like to know why all this message error printed out?



Solution 1:[1]

You can get rid of some messages if you use ARView instead of some UIView:

func makeUIView(context: Context) -> ARView { ... }
func updateUIView(_ uiView: ARView, context: Context) { ... }

You should ignore the rest of the console messages, since Xcode 13.3 generates them even if you have a completely empty scene in RealityKit with render options disabled. Just try this code:

struct ARViewContainer: UIViewRepresentable {
    
    let arView = ARView(frame: .zero)
         
    func makeUIView(context: Context) -> ARView {

        arView.environment.lighting.resource = nil
        
        arView.renderOptions = [.disablePersonOcclusion,
                                .disableAREnvironmentLighting,
                                .disableCameraGrain,
                                .disableDepthOfField,
                                .disableFaceMesh,
                                .disableGroundingShadows,
                                .disableHDR,
                                .disableMotionBlur]
        return arView
    }
    func updateUIView(_ uiView: ARView, context: Context) { }
}

Result:

2022-05-01 13:54:09.705211+0300 dell[28410:1243021] Metal GPU Frame Capture Enabled
2022-05-01 13:54:09.705618+0300 dell[28410:1243021] Metal API Validation Enabled
2022-05-01 13:54:11.584702+0300 dell[28410:1243021] [AssetTypes] Registering library (/System/Library/PrivateFrameworks/CoreRE.framework/default.metallib) that already exists in shader manager. Library will be overwritten.
2022-05-01 13:54:11.802761+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/suFeatheringCreateMergedOcclusionMask.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.844584+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arKitPassthrough.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.845894+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/drPostAndComposition.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.846809+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arSegmentationComposite.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.847909+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute0.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.849259+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute1.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.849770+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute2.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.860031+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute3.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.860581+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute4.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.861061+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute5.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.861551+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute6.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.862043+0300 dell[28410:1243021] [Assets] Resolving material name 'engine:BuiltinRenderGraphResources/AR/arInPlacePostProcessCombinedPermute7.rematerial' as an asset path -- this usage is deprecated; instead provide a valid bundle
2022-05-01 13:54:11.862930+0300 dell[28410:1243021] [Foundation.Serialization] Json Parse Error line 18: Json Deserialization; unknown member 'EnableARProbes' - skipping.
2022-05-01 13:54:11.862969+0300 dell[28410:1243021] [Foundation.Serialization] Json Parse Error line 20: Json Deserialization; unknown member 'EnableGuidedFilterOcclusion' - skipping.
2022-05-01 13:54:12.069798+0300 dell[28410:1243021] throwing -10878
2022-05-01 13:54:12.071608+0300 dell[28410:1243021] throwing -10878
2022-05-01 13:54:12.071787+0300 dell[28410:1243021] throwing -10878
2022-05-01 13:54:12.071929+0300 dell[28410:1243021] throwing -10878
2022-05-01 13:54:12.072155+0300 dell[28410:1243021] throwing -10878
2022-05-01 13:54:12.072412+0300 dell[28410:1243021] throwing -10878
2022-05-01 13:54:12.072587+0300 dell[28410:1243021] throwing -10878
2022-05-01 13:54:12.072861+0300 dell[28410:1243021] throwing -10878
2022-05-01 13:54:12.073079+0300 dell[28410:1243021] throwing -10878
2022-05-01 13:54:13.111680+0300 dell[28410:1243229] [Technique] ARWorldTrackingTechnique <0x114229fb0>: World tracking performance is being affected by resource constraints [2]


Turn messages off

If those messages are really annoying for you, just turn them off.

Go to Xcode's menu Product Scheme Edit Scheme and add you environment variable.

OS_ACTIVITY_MODE = disable

enter image description here

Solution 2:[2]

Remove arView.debugOptions and see.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Tadreik