Hi everyone, I'm using assets bundle to manage resources on Android.
I called LoadFromFileAsync to load assetsbundle in streaming assets,
when assets load done, I called LoadAsset() to get GameObject that I want.
I found that everytime I called LoadAsset, Application will crash (and there is no any error message).
**Here's the code I load assetsbundle:** IEnumerator AddPack(string packName) { var Assets = AssetBundle.LoadFromFileAsync(Path.Combine(Application.streamingAssetsPath, packName)); while (!Assets.isDone) { yield return null; } yield return Assets.assetBundle; if (Assets.assetBundle.isStreamedSceneAssetBundle) { yield return LoadScene(Assets); yield break; } AssetBundles.Add(Assets.assetBundle); } **And how I get it** foreach (var bundle in AssetBundles) { T getresult = bundle.LoadAsset(name);
if (getresult != null)
{
return getresult;
}
}
**Some Test result**
- The file I want to load is actually in the pack - Only load GameObject will cause crash. - It crashed on SAMSUNG SM P610, but won't crash on Pixel 6.
Thanks for reading this question Q_Q
I called LoadFromFileAsync to load assetsbundle in streaming assets,
when assets load done, I called LoadAsset() to get GameObject that I want.
I found that everytime I called LoadAsset, Application will crash (and there is no any error message).
**Here's the code I load assetsbundle:** IEnumerator AddPack(string packName) { var Assets = AssetBundle.LoadFromFileAsync(Path.Combine(Application.streamingAssetsPath, packName)); while (!Assets.isDone) { yield return null; } yield return Assets.assetBundle; if (Assets.assetBundle.isStreamedSceneAssetBundle) { yield return LoadScene(Assets); yield break; } AssetBundles.Add(Assets.assetBundle); } **And how I get it** foreach (var bundle in AssetBundles) { T getresult = bundle.LoadAsset
- The file I want to load is actually in the pack - Only load GameObject will cause crash. - It crashed on SAMSUNG SM P610, but won't crash on Pixel 6.
Thanks for reading this question Q_Q