Reputation: 3
I am curently developing an vuforia app on Hololens 2 using Unity engine (2020.3.35f).
I am using the official Sample Hololens 2 project provided here.
I am using the Imagetarget scene, and i have tried to put my own marker.
When i lanch the app using a webcam in the Unity editor, it work perfectly fine, but when i build the app using VS2022 and upload it on a Hololens 2, the examples marker provided by vuforia work perfectly fine, but my own marker don't work.
When i check the log on the headset, it seams that it's a licence issue.
Exception in callback: Failed to create ImageTargetObserver: Make sure that a license key is provided in the Vuforia Configuration.
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:LogFormat(LogType, String, Object[])
UnityEngine.Debug:LogErrorFormat(String, Object[])
Vuforia.Internal.Utility.UnityLogger:LogError(String, Object[])
Vuforia.Internal.Utility.Log:Error(String, Object[])
Vuforia.Utility.ExtensionMethods.DelegateHelper:InvokeDelegate(Delegate, Object[])
Vuforia.Internal.Core.Engine:add_OnVuforiaStarted(Action)
Vuforia.ObserverBehaviour:Awake()
In the Vuforia Configuration, i have check and double check that a correct licence was given, and it is the case.
I am using a basic licence for this app. The vuforia Website says that you don't need to pay to use basic feature like Image Target. I have generated a new licence key only for this project.
I think that when i am building the app, the licence is not imported in the headset, and vuforia don't create the image target.
it does work for the base marker as you don't need an licence to use those.
How can i put the licence key on the headset if this is the issue ?
I am really sorry for my bad english, and it's my first post on Stack Overflow so do not hesitate to tell me if i have made something wrong.
Have a great day !
Upvotes: 0
Views: 430
Reputation: 26
I do have the same problem with Vuforia 10.15 using Unity 2020.3.30f on HoloLens 2. I don't know why the license key is not added in the build time, but a workaround I figured out is that you could initialize Vuforia engine at the runtime. For example:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Vuforia;
public class VuforiaFixScript : MonoBehaviour
{
private void Awake()
{
VuforiaConfiguration.Instance.Vuforia.LicenseKey = "YourlicenseKey";
}
// Start is called before the first frame update
void Start()
{
VuforiaApplication.Instance.Initialize();
}
// Update is called once per frame
void Update()
{
}
}
I took a few lines of the code from: https://library.vuforia.com/getting-started/vuforia-engine-api-unity
Paste your license key in and give it a try. Hope that works for you.
Upvotes: 1