Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Building player but not rebuild player content

Discussion in 'Addressables' started by Andrew_Zim, Aug 27, 2019.

  1. Andrew_Zim

    Andrew_Zim

    Joined:
    Aug 30, 2017
    Posts:
    18
    We have the app, which read addressable assets from the remote server, this part works well.
    But, it looks like every time we create player build (.apk in our case), we should build player content, should we?
    My problem is that i don't want my partners to rebuild addressable bundles, only make .apk and test it - using addressable assets, I've already put on the server. Is there a way to handle this?
     
  2. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    411
    What's the problem you meet if you don't rebuild the addressable bundles with your app?
     
  3. Andrew_Zim

    Andrew_Zim

    Joined:
    Aug 30, 2017
    Posts:
    18
    I can't reach assets (using labels, for example)
     
  4. Andrew_Zim

    Andrew_Zim

    Joined:
    Aug 30, 2017
    Posts:
    18
    For now, I see that the solution will be to point directly to a catalog using :
    Addressables.LoadContentCatalogAsync(catalogPath).Completed += OnCompleted;
     
  5. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    411
    Well, I don't quite get why exclusive LoadContentCatalogAsync solves your problem. It should work, either new app build with existing bundle, or old app build with new bundles. It's the fundamental feature the system provides. There could be some special case it won't work well like new build requires some script that not existing on old bundle. But from your description it unlikely this reason.

    There's not much information for further investigation. Maybe you could enable ADDRESSABLES_LOG_ALL set as a compiler directive in your player settings. So you know why it falls.
     
    Last edited: Aug 28, 2019
  6. Andrew_Zim

    Andrew_Zim

    Joined:
    Aug 30, 2017
    Posts:
    18
    in my pc - there no problem,
    but when I create build from other pc - the app not loading bundles properly
    that's why I decided to use LoadContentCatalogAsync
    Maybe, I do something wrong, sorry. And thank you for your replies
     
    Last edited: Aug 28, 2019
  7. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    1,023
    When you do a content build, it creates the asset bundles as well as catalog and settings files to be read at runtime. We store these files in the Library folder because they are unique to the platform built and shouldn't be in source control (in Assets). During a player build, we copy them from the Library into StreamingAssets.

    So if you want others to build the player, they either need to rebuild content as well, or you need to send them the Library folder (specifically Library/com.unity.addressables). We are exploring other places to put the data, but there isn't really a good option with how Unity handles it's folders.


    If they are rebuilding the content, then by default the catalog will have a new name, which means it won't recognize any updates on the catalog you've already hosted. To fix this, use the "Player Version Override" setting in the inspector for the AddressableAssetSettings object. If this is set, your catalog will be named with this version rather than the timestamp as is the default.
     
    Favo-Yang likes this.
  8. Favo-Yang

    Favo-Yang

    Joined:
    Apr 4, 2011
    Posts:
    411
    Okay, I didn't realize the issue is about team collaboration. Here's a setup for sharing built assets for bigger team.

    Typical configuration
    - Default local group, for local assets ship with app build.
    - Remote group(s) for remote assets uploaded to content server.
    - Remote build path set to ServerData/[BuildTarget].
    - Build Remote Catalog enabled.
    - Optional override Player Version Override, it's not that necessary if you sync Library/com.unity.addressables folder as well (see below for details).
    - Dedicated commit to build and upload assets to content server.

    When add new assets

    1) build player content once. You will get something like this.
    upload_2019-8-29_12-2-19.png

    2) Upload ServerData to content server.

    3-a) Share local group content (in most case you have), Library/com.unity.addressables with both settings and local bundles.
    - You can commit it into git with git-lfs, if you don't mind build content messy with source code.
    - Or find another way to sync those content with team member, like a little editor script. But you lose the version control. Anyway version control with bigger team in unity is hard in general.

    3-b) If you don't have any local group content, you can override Player Version Override, which gives you fixed catalog file name. Then commit into git. Should be just one time job, as nothing really change in future.
     
    unity_bill likes this.
  9. Andrew_Zim

    Andrew_Zim

    Joined:
    Aug 30, 2017
    Posts:
    18
    Thanks a lot, Bill I've already copied data form Library and it is work for me, but the catalog address it is still hardcoded, so I will consider on your advise about Player Version Override
     
    unity_bill likes this.
  10. Andrew_Zim

    Andrew_Zim

    Joined:
    Aug 30, 2017
    Posts:
    18
    Thank you very much! Yes, I have only remote assets, for now, I will use the Player Version Override - because my partners don't want /have time to handle assets - addressable are all on my side
     
unityunity