I’m experiencing a persistent issue where the Vuforia database is not recognized when I build my app as an Android App Bundle (AAB) with split binary options. However, when I build the project as an APK, everything functions correctly.
Here’s what I’ve explored so far:
I understand that there are specific considerations with the StreamingAssets folder in AAB, such as potential delays in downloading contents. I attempted to package the Vuforia database using AssetBundles. Unfortunately, it seems that the .dat file cannot be included in an AssetBundle. For reference, the app does upload and I can open it. It is just Vuforia which doesnt work!
I have a loading scene in Unity and my main Scene which gets loaded after
Setup Details:
Unity 2022.3.25f1
Vuforia 10.22.5
Build App Bundle (Google Play) [Check]
Split Application Binary [Check]
Base Scene Size: ~50MB
Main Scene Size: ~1.5GB
I’ve spent numerous hours over several nights trying to resolve this without success. Does anyone have suggestions on how to ensure the Vuforia database is properly recognized and loaded in an AAB format? Any insights or fixes would be greatly appreciated.
Thank you, MotionBrain
I tried this to delay the streaming asset folder.
IEnumerator Start()
{
#if UNITY_EDITOR
yield return null;
#else
string[] assetPackNames = AndroidAssetPacks.GetCoreUnityAssetPackNames();
if (!AndroidAssetPacks.coreUnityAssetPacksDownloaded)
{
yield return StartCoroutine(WaitForAssetPacksDownload(assetPackNames));
}
else{
yield return StartCoroutine(CheckAssetPacksDownloaded(assetPackNames));
}
#endif
}
IEnumerator WaitForAssetPacksDownload(string[] assetPackNames)
{
bool allDownloaded = false;
// App cannot load without UnityStreamingAssetsPack being downloaded first
while (!allDownloaded)
{
var operation = AndroidAssetPacks.GetAssetPackStateAsync(assetPackNames);
yield return operation; // Wait for the state check to complete
if (operation.isDone)
{
allDownloaded = true;
}
if (!allDownloaded)
{
// Wait before checking again to avoid spamming checks
yield return new WaitForSeconds(3);
}
}
errorTtext.SetText("All asset packs downloaded.");
AsyncOperation asyncOperation = SceneManager.LoadSceneAsync(1);
asyncOperation.allowSceneActivation = false;
while (!asyncOperation.isDone)
{
float progress = asyncOperation.progress * 100;
loadingPercent.text = (int)progress + "%";
if (asyncOperation.progress >= 0.90f)
{
yield return new WaitForSeconds(5);
asyncOperation.allowSceneActivation = true;
}
yield return null;
}
}
Thank you,
MotionBrain