Search Unity

Duplicate Bundle Rule (Question)

Discussion in 'Addressables' started by webjeff, Oct 4, 2019.

  1. webjeff

    webjeff

    Joined:
    Mar 11, 2015
    Posts:
    31
    Hi,

    I have a test project, where I have 2 scene object. 1 is a normal game object (cube) and 1 game object that loads an asset reference/addressable (sphere). Both share a material + texture. The texture is quite large for testing purposes. When I build the asset bundle (addressable), that texture appears to be in both the asset bundle and my main apk. I can tell by the size, if I just reference that texture from the asset reference and not my in-game scene object then the apk size is much smaller.

    However, the analyzer did not report any duplicates. Does it only check duplicates in various bundles and not what's also included in the app? Is there a way to check that as well?

    Thanks!
     
  2. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    954
    Are you on the latest package (1.2.4)? I don't remember when we added, it but at least in the latest, there's an analyze rule for checking for duplicate dependencies between built in scenes and addressable things. It's under the "unfixable rules" because there isn't really anything we can do to fix it. If your built in scene depends on a texture, and your addressable thing depends on a texture, Unity will require that to be in two places. We can't avoid that. Only fix is to pull the scene from your built in scenes list. (perhaps making it addressable, and loading it from some bootstrap scene)
     
  3. webjeff

    webjeff

    Joined:
    Mar 11, 2015
    Posts:
    31
    Hi @unity_bill ,

    I'm using 1.2.4 (latest w/ Unity 2019.2.6). Yes, this is the situation I'm trying to detect manually, so I can fix it - I have a small project just for testing purposes. Look at this screenshot, maybe I'm doing something wrong.

    What I'm trying to detect is that I have a 'BigMaterial' material on a cylinder in the scene and I have that same 'BigMaterial' material on a cube that's set up for an addressable. The analyzer does show it's now implicitly included in the bundle, however notice after I run the analyzer, on all rules, there's no issues found in that "Scene to Addressables duplicate dependencies" section.

    Shouldn't I see that material listed there?

    Thanks!
     

    Attached Files:

  4. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    954
    yes? no?
    we'll look into it. It's very possible that our first quick-pass implementation isn't as complete as it should be.
     
  5. DavidUnity3d

    DavidUnity3d

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    8
    Hey @webjeff this definitely sounds like a bug. It's possible in our analysis we only look for scene dependencies that are explicitly marked Addressable and don't take into consideration implicit references from the Addressable asset. We'll look into it.