Log in or register to post comments

Split Android Binary doesn't work (already tried stickied topic)

September 6, 2018 - 10:19am #1

I can't get Split Application Binary to work with vuphoria even when using the code in the stickied topic on this subject.

(I realised I spelled vuforia wrong in some of my method and field names - but I have it correct where it needs to be correct)

I am doing this in a 'menu' screen that is used where vuforia isn't used.  The 'UIController.VuphoriaDataLoaded' prevents the user from pushing the button that changes over to the camera scene until all the data is loaded - but it happens nearly instantly so I probably didn't need to do that.  I have delayed initialization turned on.  (I have also tried it with delayed initialization off and not doing the initVuforia here)

The array of strings 'keys' is a list of all the dataset keys that need to be loaded.  All of the save debugs return values that say things are saved properly.

using System.IO;<br>
	using System.Collections;<br>
	using UnityEngine;<br>
	using UnityEngine.SceneManagement;<br>
	using Vuforia;</p>
	public class ObbExtractor : MonoBehaviour {<br>
	    public static void initVuphoria() {<br>
	        UIController.VuphoriaDataLoaded = true;<br>
<p>    int startCount = 0;<br>
	    int doneCount = 0;</p>
<p>    public string[] keys = new string[] { };</p>
<p>    void Start() {<br>
	        UIController.VuphoriaDataLoaded = false;<br>
	        foreach (string s in keys) {<br>
<p>    private IEnumerator ExtractObbDatasets(string file) {<br>
	        string[] filesInOBB = { file+".dat", file+".xml" };<br>
	        foreach (var filename in filesInOBB) {<br>
	            string uri = Application.streamingAssetsPath + "/Vuforia/" + filename;</p>
<p>            string outputFilePath = Application.persistentDataPath + "/Vuforia/" + filename;<br>
	            if (!Directory.Exists(Path.GetDirectoryName(outputFilePath)))<br>
<p>            var www = new WWW(uri);<br>
	            yield return www;</p>
<p>            Save(www, outputFilePath);<br>
	            yield return new WaitForEndOfFrame();<br>
	        // When done extracting the datasets, Start Vuforia AR scene<br>
	        if (doneCount >= startCount)<br>
<p> </p>
<p>    private void Save(WWW www, string outputPath) {<br>
	        File.WriteAllBytes(outputPath, www.bytes );</p>
<p>        // Verify that the File has been actually stored<br>
	        if (File.Exists(outputPath)) {<br>
	            ShivaDebug.Log("File successfully saved at: " + outputPath);<br>
	        } else {<br>
	            ShivaDebug.Log("Failure!! - File does not exist at: " + outputPath);<br>
Log in or register to post comments