Vuforia not working

Versions;
• Unity 2022.2.0b8
• Magic Leap SDK 0.53.3
Magic Leap XR Plugin 7.0.0-exp.3
• Vuforia Engine AR 10.10.2
• HMD OS; Build: B3E.220721.07-R.027_user (Internal device) - SDK Version 29

From our test the MagicLeap 2 Integration is not doing anything. It works fine in the editor through a webcam, and fine on HoloLens, but can't get any image recognition to work on the ML2 HMD.
What we've tried;
• The log doesn't give any errors or warnings - just that no pose was found;

Target status: vuforia_image_test-2 NO_POSE -- NOT_OBSERVED
DefaultObserverEventHandler:OnObserverStatusChanged(ObserverBehaviour, TargetStatus)
DefaultObserverEventHandler:Start()

• All permissions are given (including marker tracking and camera).

Although, even though permissions are given in the manifest and requested using MLPermissions.RequestPermission(), and then validated using MLPermissions.CheckPermission(), we can't get permissions for;
Pupil Size
World_Reconstruction
Write_External_Storage
Although those permissions should not be necessary for vuforia
• We've tried adding an intermediate scene that launches into the vuforia scene - no changes
• We've tried using delayed initialization

With manual initialization we're getting this error;

Error: The file '/data/app/com.Laerdal.VuforiaTest-dAaNa5tNMzB1-nQkQAWPGA==/base.apk/assets/bin/Data/level1' is corrupted! Remove it and launch unity again!

when using this script to start up vuforia;


using System;
using System.Collections;
using System.Collections.Generic;
using System.Threading.Tasks;
using UnityEngine;
using Vuforia;

public class CustomVuforiaStarter : MonoBehaviour
{
    private void OnEnable()
    {
        Debug.Log("OnEnable!");
        VuforiaApplication.Instance.OnVuforiaInitialized += OnVuforiaInitialized;
        VuforiaApplication.Instance.OnVuforiaStarted += OnVuforiaStarted;
        VuforiaApplication.Instance.OnVuforiaPaused += OnVuforiaPaused;
        VuforiaApplication.Instance.OnVuforiaStopped += OnVuforiaStopped;
        VuforiaApplication.Instance.OnVuforiaDeinitialized += OnVuforiaDeinitialized;
    }
    private void OnDisable()
    {
        VuforiaApplication.Instance.OnVuforiaInitialized -= OnVuforiaInitialized;
        VuforiaApplication.Instance.OnVuforiaStarted -= OnVuforiaStarted;
        VuforiaApplication.Instance.OnVuforiaPaused -= OnVuforiaPaused;
        VuforiaApplication.Instance.OnVuforiaStopped -= OnVuforiaStopped;
        VuforiaApplication.Instance.OnVuforiaDeinitialized -= OnVuforiaDeinitialized;
    }
    private void OnVuforiaDeinitialized()
    {
        Debug.Log("[Vuforia] Vuforia Deinitialized!", this);
    }

    private void OnVuforiaPaused(bool obj)
    {
        Debug.Log("[Vuforia] Vuforia Paused!", this);
    }

    private void OnVuforiaStopped()
    {
        Debug.Log("[Vuforia] Vuforia Stopped!", this);
    }

    private void OnVuforiaStarted()
    {
        Debug.Log("[Vuforia] Vuforia Started!", this);
    }

    private void OnVuforiaInitialized(VuforiaInitError obj)
    {
        if(obj != VuforiaInitError.NONE)
        {
            Debug.LogError("Error initialing! \n+" +
                           "Error; \n" +
                           obj);
            return;
        }
        Debug.Log("[Vuforia] Initialized!", this);
    }

    private async void Start()
    {
        Debug.Log("Start!");
        await Task.Delay(1000);
        VuforiaBehaviour.Instance.enabled = true;
        VuforiaApplication.Instance.Initialize();
    }
   
   
}

Deleting this script from the scene allows the scene to load fine.

1 Like

Hi there,

Did you follow the exact steps and workarounds provided in the documentation?

Note: I can't seem to share links on the forums, but you can find the alpha documentation via our library on the Developer Portal of Vuforia Engine and go to "Vuforia Engine -> Getting Started -> Development Environments -> Lumin Magic Leap 2".

Thanks!

Kind regards,
Patrick Scheper
Vuforia Engine Product Manager

1 Like

@pscheper , I've upgraded your trust level. Hopefully, you'll have a better time with links, now.

In the meantime, @TheMunk , I suspect this is what @pscheper was hoping to link:

1 Like

Yes I followed these steps.

1 Like

The guide doesn't mention this window. Should I select Yes?

update-assembles-popup

1 Like

Hey there,

Does that mean that after building the application onto the device you run into this error:

Error: The file '/data/app/com.Laerdal.VuforiaTest-dAaNa5tNMzB1-nQkQAWPGA==/base.apk/assets/bin/Data/level1' is corrupted! Remove it and launch unity again!

Thanks!

Kind regards,
Patrick Scheper
Vuforia Engine Product Manager

1 Like

Hi,

Also assuming that you followed all the steps in the guide? Can you share when this window popped up?

I also suggest creating a separate thread.

Kind regards,
Patrick Scheper
Vuforia Engine Product Manager

1 Like

@pscheper yes, this error happens on builds. Not in the editor.

1 Like

Hey,

Could you share some additional details about how you ended up in the current state of your project? Some other questions / feedback that I gathered from our team:

  1. What is in your Packages folder on your Unity project? This should contain com.ptc.vuforia.engine directory in there and not com.ptc.vuforia.engine-10.x.y.tgz.

  2. Packages/manifest.json should not contain an entry of com.ptc.vuforia.engine.

    • Assets/Editor/Migration should only contain AddVuforiaEnginePackage and not com.ptc.vuforia.engine-10.x.y.tgz.

Can you check the above?

Kind regards,
Patrick Scheper
Vuforia Engine Product Manager

1 Like
  1. I don't have the .tgz anywhere in the project.
  2. I imported the .unityPackage (but never got the "import warning" prompt), unzipped the .tgz placed it in a folder outside assets (but still in the git project), and then added the package from the packagemanager. So yes, I do have com.ptc.vuforia.engine in the package manager, but it's the local one from disk.
  3. This is all I have as well.

During this process I never got the prompts to import the package (may be because I imported and denied the prompt in a previous attempt)
I did get the API update prompt and seleted "no".

1 Like

Alrighty, so after getting vuforia to work in a fresh project, and checking that every package, playersetting, and SDK was the same, the only difference seemed to be the fact that the package was added from disk using the package manager vs just dropping it in the packages folder.

I don't understand why this makes a difference though - may be because of some internal vuforia scripts that are hardcoded to do changes to "projectRoot/packages/com.ptc.vuforia.engine"?

Can you shine some light on this limitation?

3 Likes

Hey there,

Yeah, that could very well be. Currently the process is a little wonky at times. This should disappear once the release goes into beta / full release.

Glad you were able to get it to work. Are you saying that going through the workflow by dropping the .unitypackage did not work for you, but from the package manager it did?

Kind regards,
Patrick Scheper
Vuforia Engine Product Manager

2 Likes

No I did use the .unityPackage - what didn't work was adding the unzipped package (that get's imported from the .unityPackage) using the package manager (when the vuforia package was in another location than "projectRoot/packages/com.ptc.vuforia.engine").

3 Likes

Your not wrong, I went through this also.

2 Likes