Hi.
I’m trying to use AssetDatabase.LoadAssetAtPath to load a ScriptableObject instance in the Pre-Export callback, and it fails on Cloud Build. Locally, it works. I have even confirmed that the file exists on Cloud Build by calling System.IO.File.Exists(). I can see the asset and its meta file in the repo, too.
I tried loading a json-file from the same path, and that works just fine. I don’t want to use a json file, because that brings a whole lot of other issues when it comes to implementation of a custom inspector.
// This verifies that the file exists
string abcPathRelative = "Assets/AssetBundleConfig.asset";
string abcPathFull = Application.dataPath + "/AssetBundleConfig.asset";
Debug.Log("[BV] Does "+abcPathFull+" exist? "+(File.Exists(abcPathFull) ? "Yes" : "No"));
// This returns 0
string[] configs = AssetDatabase.FindAssets("t:AssetBundleConfig");
Debug.Log("[BV] Found "+configs.Length+" AssetBundleConfig files");
foreach (string c in configs) {
Debug.Log("[BV] config: "+AssetDatabase.GUIDToAssetPath(c));
}
// This one fails
AssetBundleConfig config = AssetDatabase.LoadAssetAtPath<AssetBundleConfig>(abcPathRelative);
if (config == null) {
Debug.Log("[BV] Cannot load AssetBundleConfig from " + abcPathRelative);
}
Is this is a known problem with Cloud Build?