App crashing when Entering AR 4.1.0 alpha.11

Hello,
I have installed the new Needle 4.1.0 alpha.11 and Needle Engine Samples 0.20.0-exp in Unity 6000.0.34f1 .
When I try to open AR on Android I get a black screen, and on returning to the previous page there is an error message.
I did a clean reinstall and in the new project it is the same, I used samples Character (Everywhere actions) and Animator (Everywhere actions).


Hi Tomislav Å tefan,

From the details you’ve provided, it looks like the black screen issue when entering AR might be linked to the WebARSessionRoot or related AR components in your Needle Engine setup. This could potentially be an issue with the placement or initialization of AR components when entering the AR session (see the documentation).

Here are a few troubleshooting steps:

  1. Update and Compatibility Checks:

    • Make sure that you’re using compatible versions of Unity, Needle Engine, and your Android OS. Check for any updates or patches that might address this specific issue.
  2. WebARSessionRoot Initialization:

    • Verify how the WebARSessionRoot is initialized in your project. Ensure that components are correctly reparented and the placement logic of the AR scene is correctly executed (see the documentation).
  3. ClearFlags and Background Handling:

    • If your AR camera’s background settings aren’t handled correctly, this could lead to a black screen. Ensure that ClearFlags and other background settings are correctly parameterized for AR (see the documentation).
  4. Device Specific Debugging:

    • Since you’re experiencing this issue on Android, try to gather more logs specifically from Android’s logcat. Check if there’s more specific feedback or error information in those logs.
  5. Rendering and Resources Management:

    • Make sure that the object and resources re rendering properly by checking the console logs for any related errors during the rendering process.
  6. Cross-validation with Needle Engine Samples:

    • Run the Needle Engine samples as standalone projects to check if the problem persists. This might help in isolating the issue as project-specific or component-related.

Consider providing logs or additional console outputs from your Android device to pinpoint more specific errors. Also, ensuring that your Needle Engine version and other toolchain components are fully up-to-date can often resolve unexpected behaviors. Feel free to explore more of the AR-specific documentation on Needle Engine.

Let me know how it goes, or if you need further assistance!

24 replies left
thread_Cl7nPE968WIZIID1mvnz89f2
Reply to this message to continue the conversation

Could you try again with the samples updated to 0.20.0-exp.1 ?

Manged to install 0.20.0-exp.1 examples and it is the same.
I am using Uniy 6000.0.34f1

Ok, ill check tomorrow if I can reproduce it.

Does the same happen in a fresh template for you too? (new unity scene and select the CollabSandbox scene template)

The same is with the Sandbox scene

Hello Stefan,

I’ve tried again here with the latest versions and couldn’t reproduce the error you see.

Could you try again deleting the node_modules/.vite folder in your web project and then start the local server again?

If that doesn’t fix the issue please send a bugreport from Unity using the menu item Needle Engine/Report a Bug. Thank you

It seems that on my Phone I got this error Samsung Galaxy 20FE and on Samsung Galaxy Tab Ultra it works.

Which phone do you have? The Samsung Galaxy 20FE? What browser are you using?

Could you try this page on your phone that doesnt work? Immersive AR Session

Yes Galaxy 20FE and Chrome, this scene you sent, Immersive AR session works.

Ok, how about this one? three.js examples

The only place i can find that calls createProjectionLayer is the WebXRManager in three.js

This one also works

Sorry I think that was the wrong example. Could you try this in AR? three.js examples

Yes, this one also works.

Does this also reproduce the error? https://collaborativesandbox-svelte-test-z23hmxb1qqhtj-1qqhtj.my3d.app/

Yes, when I start this AR screen is black.

Ok - and with the ?console parameter do you get the same error as above (after exiting AR). Could you send me the full logs?

Here is the console log

three-quarks.231f82bc.js:1039  Particle system powered by three.quarks. https://quarks.art/
vconsole.min.js:10 [system] Location: https://collaborativesandbox-svelte-test-z23hmxb1qqhtj-1qqhtj.my3d.app/?console=&room=580435
vconsole.min.js:10 [system] Client: Android 10
vconsole.min.js:10 [system] UA: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Mobile Safari/537.36
vconsole.min.js:10 🌵 Debug console has loaded
vconsole.min.js:10 [system] navigationStart: 1737545915610
vconsole.min.js:10 [system] navigation: 27ms
vconsole.min.js:10 [system] dns: 0ms
vconsole.min.js:10 [system] tcp: 0ms
vconsole.min.js:10 [system] request: 18ms
vconsole.min.js:10 [system] response: 3ms
vconsole.min.js:10 [system] domComplete (domLoaded): 299ms (297ms)
vconsole.min.js:10 [system] loadEvent: 0ms
vconsole.min.js:10 [system] total (DOM): 484ms (484ms)
vconsole.min.js:10 THREE.WebGLRenderer: KHR_parallel_shader_compile extension not supported.
e.callOriginalConsole @ vconsole.min.js:10
vconsole.min.js:10 [Spectator Camera] Click other avatars or cameras to follow them. Press ESC to exit spectator mode.
vconsole.min.js:10 Requesting immersive-ar session
needle-engine@4.1.0-experimental.13.js:230 Unsupported feature requested: layers
start @ needle-engine@4.1.0-experimental.13.js:230
await in start
(anonymous) @ needle-engine@4.1.0-experimental.13.js:1283
vconsole.min.js:10 Started immersive-ar session
three@0.169.3.js:3847 Uncaught (in promise) TypeError: h.createProjectionLayer is not a function
    at pR.setSession (three@0.169.3.js:3847:3900)
setSession @ three@0.169.3.js:3847
await in setSession
oo @ needle-engine@4.1.0-experimental.13.js:230
setSession @ needle-engine@4.1.0-experimental.13.js:230
start @ needle-engine@4.1.0-experimental.13.js:230
await in start
(anonymous) @ needle-engine@4.1.0-experimental.13.js:1283
three@0.169.3.js:44 Uncaught TypeError: Cannot read properties of null (reading 'cancelAnimationFrame')
    at Object.stop (three@0.169.3.js:44:4440)
    at XRSession.$ (three@0.169.3.js:3847:2180)
stop @ three@0.169.3.js:44
$ @ three@0.169.3.js:3847

Perfect, thanks, looks like this safety check was just added to three.js in the past few weeks. I’ll look into if we can easily backport those features (we’ll update to latest soon but are not right now)

Great thanks on support