Does anyone know how to identify the missing behaviour?
THank
Try setting the “Monoscript bundle naming” setting to anything other than “Disabled” in main addressable settings inspector.
Thank you so much. We had some totally weird bugs with some of our Addressables and I was nearly going to relayout all our groups. Then I discovered your tip and.. it just works!
As a reference for others: In addition to the “The references script (Unknown) on this Behaviour is missing!” we got errors like these when loading a scene via addressables:
GameObject (named 'xyz) references runtime script in scene file. Fixing!
GameObject (named 'xyzz') references runtime script in scene file. Fixing!
Setting “Monoscript bundle naming” to “Project Name” fixes the issues for our project.
Thank Phobos, seem to do the job… an other addressable mystery
Thanks a lot for that! You saved my nerves, or rather everything that is left of them at the moment after looking for answers to errors generated by addressables.
Additional thanks to orb_9 for linking to this thread on
Which version of Addressables are you using? This option was present in specific versions where I encountered this error.
1.16.19
i had a same problem i went to Edit > Prefrences >Asset Pipline >Directory Monitoring turn it off
Getting this error currently. I’m using two projects, one for making/exporting content and a main source project.
My content seems to load in fine and functions as expected, just with 20 or so of these damn warnings from my content scripts. The assets were originally created in an older project and imported into the content making/exporting project. I think this has something to do with it as my test bundles made in the current project, using the same scripts, don’t output these warnings.
Using Unity 6000.0.19f1 & Addressables 2.2.2.
Monoscript bundle naming is now by default set to Project Name Hash
I’m also getting the same problem using multiple builds. And could not find a fix. I’m using the default value “Project Name Hash” and tried other options without success. Could someone from the team advise please?
Does the code exist across both projects? Addressables groups (aka Asset Bundle) don’t contain the code themselves.
I’m actually building from the same project, setting Groups dynamically per build set. So yes, the code does exists. And I have Code Stripping off in Player Settings.
This used to work just fine with Addressables 1.19.19, but it broke after upgrading to Unity 6 / Addressables 2.4.6 and I can’t figure it out. I’m simply trying to load a ScriptableObject asset (System.Exception: Unable to load asset of type Locations from location Assets/Locations.asset, assuming it’s missing its script) and scenes with some (not all) scripts being missing (The referenced script (Unknown) on this Behaviour is missing!)
Did you find what was wrong? I build asset bundles with addressables, then load them in AssetBundle API and I get missing script warning. I also used just one project so those can’t be missing, but I still get those errors.
I guess it tries to find them by GUID and somehow it’s wrong? (I can select missing script manually after load)
I have not but I found a workaround editing catalogs and moving files to the remote build folder post build. Here is a quick copy/paste snippet that I hope will help. Good luck!
AddressableManager.MigrateLocalToRemoteCatalogEntries(new FileInfo(Path.Combine(AppSettings.ADDRESSABLES_REMOTE_BUILD_PATH, $"catalog_{catalogId}.json")));
public static void MigrateLocalToRemoteCatalogEntries(FileInfo catalog)
{
if (catalog.Exists)
{
string catalogString = File.ReadAllText(catalog.FullName);
JSONNode json = JSON.Parse(catalogString);
string hash = string.Empty;
if (json["m_BuildResultHash"])
hash = json["m_BuildResultHash"].Value;
if (!hash.IsNullOrEmpty())
{
if (json["m_InternalIds"] != null)
{
bool modified = false;
List<string> filesToMoveToRemote = new List<string>();
foreach (KeyValuePair<string, JSONNode> pair in json["m_InternalIds"].AsArray)
{
string v = pair.Value.ToString();
if (v.Contains("ADDRESSABLES_LOCAL_LOAD_PATH"))
{
string updatedPath = v.Replace("ADDRESSABLES_LOCAL_LOAD_PATH", "ADDRESSABLES_REMOTE_LOAD_PATH").Trim('"');
int dotIndex = updatedPath.LastIndexOf('.');
string finalPath = updatedPath.Insert(dotIndex, "_" + hash);
pair.Value.Value = finalPath;
#if ANDROID
string fileName = updatedPath.Split('/').Last();
#else
string fileName = updatedPath.Split('\\').Last();
#endif
filesToMoveToRemote.Add(fileName);
modified = true;
}
}
if (modified)
{
foreach (var fileName in filesToMoveToRemote)
{
var sourcePath = Path.GetFullPath(Path.Combine(Application.dataPath, "../", AppSettings.ADDRESSABLES_LOCAL_BUILD_PATH, fileName));
string fileExtension = Path.GetExtension(fileName);
string fileNameWithoutExt = Path.GetFileNameWithoutExtension(fileName);
string newFileName = $"{fileNameWithoutExt}_{hash}{fileExtension}";
var destPath = Path.GetFullPath(Path.Combine(Application.dataPath, "../", AppSettings.ADDRESSABLES_REMOTE_BUILD_PATH, newFileName));
var destFile = new FileInfo(destPath);
if(destFile.Exists)
destFile.Delete();
var sourceFile = new FileInfo(sourcePath);
if (sourceFile.Exists)
sourceFile.MoveTo(destPath);
else
Debug.Log($"Error: Migrating File failed: {sourcePath} does not exist.");
}
File.WriteAllText(catalog.FullName, json.ToString());
}
}
}
else
{
Debug.Log($"Warning! Moving local bundles to remote failed because hash was empty!");
}
}
else
{
Debug.Log($"Warning! Catalog couldn't be checked at path: {catalog.FullName}");
}
}
I found that in my case problem is different. I try to load generated bundles separately via AssetBundle API, but addressables by default try to generate monoscript bundle, it contains script definitions only and it’s assumed it’s loaded first, because it’s referenced by other bundles as long as they use scripts. So I tried to load bundle without script definitions. I don’t know how to handle my case, but for people who try to build remote content it might be something similar, because by default location of those files is driven by default group.
In any case thank you for reply!