Shared textures are included in the build?

I’m using Asset Bundles to reduce app size:

ModelA_AssetBundle
ModelB_AssetBundle
SharedTextures_AssetBundle

(Where modelA_AssetBundle contains a 3D model, prefab, materials, and textures related only to a single model. modelB_AssetBundle contains the same but only related to a different model. SharedTextures_AssetBundle contains textures that both models and prefabs from these two asset bundles share)

Now, anything assigned to ModelA_AssetBundle and ModelB_AssetBundle is omitted from the build (as is the usual case with asset bundle). However, none of the SharedTextures_AssetBundle info is omitted. Any idea what’s happening here?

Probably misconfiguration? I have shared bundle with ui sprites and multiple prefab using them and they’re ommitted in build and included in bundle.

Does the manifest say modelA and B depend on sharedtextures?

Are the files in sharedtextures directly reference from a non-assetbundle asset anywhere?

1 Like

I can’t really check if those textures are referenced anywhere. I did a manual check in my scenes, didn’t find anything. I used the asset usage detector asset ( Asset Usage Detector - Find references to an asset/object [Open Source] ) to help me out. It said that they were only referenced to materials in my project folder. Those materials are a part of an asset bundle.

I didn’t check for dependencies though. I’ll check it out and get back. I don’t see why it would stop them from being omitted though.

You kinda gotta go all the way down the rabbit hole… are any of those materials referenced anywhere, even in a disabled object somewhere in a legacy prefab or some scene?

1 Like

duplicate the textures and make your assetbundle reference the duplicates, are the duplicates omited from the build?

remove the originals, if something breaks you had a direct reference somewhere :stuck_out_tongue:

2 Likes

Thanks, guys. I found the issue.

1 Like