Log in or register to post comments

Load External Dataset Crash

August 19, 2015 - 6:25pm #1

I am trying to use an OBB file with Android and Unity.  I have an initial scene that extracts the dataset files (dat and xml) and places them in Application.persistentDataPath + "/QCAR/" + filename.  I can see that the files are indeed created on the Android device.  When the files have been extracted the AR scene is started.  The problem is that the app crashes whenever a dataset is loaded in the AR scene.  I have tried automatically loading by checking the load and activate boxes in Unity for the AR camera.  I have also tried manually loading using the code below.  When I uncomment out the middle part, the app crashes.  No exception is caught, just the dreaded "app has stopped working" message. I have set the external card access in Unity player preferences as well as directly in the manifest to see if that helped, but no luck.  I'm using Unity 4.6.4 and Vuforia 4.0.

 

	void Update () 
	{
		ObjectTracker itracker = TrackerManager.Instance.GetTracker<ObjectTracker>(); 
		if (itracker == null) return;
		
		if (QCARRuntimeUtilities.IsQCAREnabled() && !mDataSetsLoaded) 
		{
			string dataSetRootDir = Application.persistentDataPath + "/QCAR/";
			foreach(string datasetName in mDataSetNames) 
			{
				if (File.Exists(dataSetRootDir + datasetName))
				{
					DataSet dataSet = itracker.CreateDataSet();
					if (dataSet != null)
					{
						try {
//							if (dataSet.Load (dataSetRootDir + datasetName, QCARUnity.StorageType.STORAGE_ABSOLUTE))
//							{
//								status = "loaded";
//								success = success && itracker.ActivateDataSet(dataSet);
//								status = success.ToString();
//							}
						} catch (UnityException ex)
						{
							status = ex.ToString();
						}
					}
				} else {
					status = status + "file not found";
				}
			}
			mDataSetsLoaded = success;
		}
	}

 

Load External Dataset Crash

August 19, 2015 - 11:41pm #2

Figured it out - it was saving an empty file, which was causing Vuforia to crash. 

Log in or register to post comments