Hi,
I have created an AssetBundle to supplement my Android .apk file and I am downloading it from my web server when the app starts up. The whole process works fine in the editor. On the device however the package downloads fine but then the app just stops doing any thing once it is finished.
I can’t see and crashes or errors coming out of the device in the Dalvik Debug Monitor.
The APK is just under 50mb and the asset bundle is about 20mb.
Here is the code I am using to load the package then load the main scene.
// Use this for initialization
void Start () {
//load external assets
StartCoroutine (LoadAssetBundle());
}
IEnumerator LoadAssetBundle (){
// Wait for the Caching system to be ready
while (!Caching.ready) yield return null;
// Load the AssetBundle file from Cache if it exists with the same version or download and store it in the cache
using(m_assetLoader = WWW.LoadFromCacheOrDownload (BundleURL, version)) {
updateDisplay = true;
yield return m_assetLoader;
updateDisplay = false;
if (m_assetLoader.error != null) throw new Exception("WWW download had an error :: " + m_assetLoader.error);
DataStore.ASSET_BUNDLE = m_assetLoader.assetBundle;
Debug.Log("LOAD COMPLETE");
DontDestroyOnLoad(DataStore.ASSET_BUNDLE);
Debug.Log("LOAD SCENE");
//load scene
async = Application.LoadLevelAsync("MainScene");
}
}
void Update() {
if (updateDisplay) {
Debug.Log("LOADING :"+m_assetLoader.progress);
loadDisplay.text = m_assetLoader.progress.ToString();
}
}