Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vuforia datasets don't load #20

Closed
Charlynux opened this issue Jun 13, 2018 · 1 comment
Closed

Vuforia datasets don't load #20

Charlynux opened this issue Jun 13, 2018 · 1 comment

Comments

@Charlynux
Copy link

We clone the react-native-unity-demo repository for "POCing around" with Unity + React Native. Wanting to play with some Vuforia, we add an ARCamera and an ImageTarget (with predefined assets).
When we build the project in Unity, AR works with no problem, but when we export it then install it on an iOS device, it doesn't work.

The application start, with the camera view (including the Vuforia watermark), but recognition doesn't work.
In logs, we found this line :
Dataset VuforiaMars_Images could not be loaded and cannot be activated.

I can see the files in UnityExport/Data/Raw/Vuforia, but maybe Vuforia search in an other directory ?

I don't know how to find more debugging informations, so any tip would be appreciated.

@Charlynux
Copy link
Author

Charlynux commented Jun 15, 2018

I fixed it !

During my search, I quickly found informations here.
But LoadDatabaseBehaviour doesn't exist anymore in Vuforia 7. By the way, the function AddExternalDatasetSearchDir is still in the documentation. I discover here how to call it in Unity code.

To fix the problem, I add a component "script" on the ARCamera. With the following code :

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

public class DataSetLoadController : MonoBehaviour {

	// Use this for initialization
	void Start () {
		var databaseLoader = DatabaseLoadARController.Instance;
		databaseLoader.AddExternalDatasetSearchDir(Application.dataPath + "/Raw/Vuforia/");
	}
	
	// Update is called once per frame
	void Update () {
		
	}
}

Just rebuild the project (Unity + iOS) and it works !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant