Check Resources to Addressable Duplicate Dependencies

In the Unity docs, I read about the analyze rule “Check Resources to Addressable Duplicate Dependencies”

In our project running this rule is showing us around ~45000 duplicates dependencies. Some of the reported assets by this rule are marked as addressables and are in the resources folder. Why are they being reported? Do these assets still need to be moved out of the resources folder?

I do see dependencies for these reported assets which are not marked as addressables. Is that the reason they show up in the rule? Do these dependencies also need to be marked as addressables? (These dependencies are not in the resources folder)

I’d first point you to the instructions about Upgrading Resources to being Addressable. The two systems should be able to coexist, but what you are seeing is expected if you have implicit dependencies that explicit assets in the Resources folder and Addressables both depend upon.

Say you have a prefab of a sphere with a red material. If you check the Addressables box on that prefab you will have an explicit asset - the prefab. You will also have an implicit asset - the red material.

If you have a prefab of a cube in the Resources folder with that red material you will end up with duplicates. One copy of the red material for the resources folder, and one copy in your Asset bundle.

In both of these cases the build will collect all of your explicit assets and the implicit assets they depend upon and bundle them up.

One of the downsides to using Resources and Addressables together is that you will see these duplicates. So it is ok to keep a prefab in Resources that has all its dependencies in the Resources folder, but it might be worth migrating everything to Addressables if you have shared dependencies. In my example the fact that we have multiple prefabs depending on the red material make it a good candidate for moving all of them into Addressables.

It’s a bit difficult to recommend a single way or organizing content since it’s very much game specific. But we do have a blog post that can help you think through how best to organize your content.

Thank you for the explanation. This does make things clear.