Search Unity

[0.5.3] Update assets on mobile

Discussion in 'Addressables' started by MomochaZ, Dec 21, 2018.

  1. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Hello

    In packed mode I update assets and rebuild player content and upload to my ftp.
    The assets can be update.I can see my new texture in game.

    But on mobile,the assets can not be update.
    Unless I rebuild a new apk and install.
    I have tried both static content and non static content.They are the same problem.

    Packed mode and mobile use the same assets data.
    In my opinion,mobile might do not need to build a new apk to install.
    It might be I reopen the app,it will read new catalog and download new assets.

    Does someone have the same issue?

    Thanks.
     
  2. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    the mobile app needs to be getting the updated content from some server. If you are pulling content from the server in your game build, and doing an update via Build for Content Update then it should work fine. Mobile is one of our main focuses for functionality. If your setup matches what I describe and it's not working, please post with some additional details.
     
  3. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Thanks for replying @unity_bill
    I will check all the settings.

    According to your describtion.
    If I want to update assets from server,I have to build via Build for Content Update.
    That means the assets need to be static content right?
    If yes,which situation will I use non static content?

    Thanks
     
  4. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Hi

    When I after Build for Content Update and want to test in packed mode.
    I get an error below.The system ask me to run Build Player Content.
    Is that a routine flow?

    Player content must be built before entering play mode with packed data. This can be done from the Addressable Assets window in the Build->Build Player Content menu command.
    UnityEngine.GUIUtility : processEvent(Int32, IntPtr)


    And I get error on mobile when open app first time.
    Here is the error message.Does it matters because app still works fine?

    Exception: Invalid path in RawDataProvider: '/storage/emulated/0/Android/data/xxx.xxx.xxx(packagename)/files/com.unity.addressables/catalog_2018.12.21.21.21.21.hash'
     
    Last edited: Dec 22, 2018
  5. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Hi
    I have follow your describtion but assets still not update.
    Here is my flow.

    Basic:
    Build Player Content => Upload bundle to http => Build apk => mobile install apk
    Update:
    Modify sprite => prepare for cocntent update => Build for content update => upload new bundle to http => reopen app

    Does the flow correct or not about update?
    If you need more detail,please tell me.
    I will offer as possible as I can.

    Thanks.
     
    MNNoxMortem likes this.
  6. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Hi

    The previous post about after Build for Content Update and get need to build player content error.
    I found that after finishing Build for Content Update the system will delete folder StreamingAssets/com.unity.addressables.
    Is it routine?
     
    MNNoxMortem likes this.
  7. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Sorry for posting a lot of reply.

    When click build player content,system will generate catalog hash and json file in streaming asset.
    And I checkout the addressable log on mobile.It seems always read this file to download bundle.

    When I change asset and build for update content the editor streaming asset's catalog will be update to new one.
    So the packed mode will see the new assets.

    But in mobile.Cause the catalog is still old so I can not update assets unless I build a new apk and install.
    Once install new apk,the catalog will replace the new one.Then I can see the new assets.

    Here is the texture from mobile
    upload_2018-12-22_17-20-32.png

    I do not confirm is correct or not.
    It still need for answer.
    Maybe my setting is error.
     
    Last edited: Dec 22, 2018
  8. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Hi,@unity_bill

    Sorry for the tag.

    I found something stucks me in AAS.

    Each time open app,AAS will read settings.json in apk(the file path is in StreamingAssets/com.unity.addressables) and get catalog info.
    Then AAS will find the catalog file in cache,if there is no file AAS will use the catalog which is also in apk(the catalog path is in StreamingAssets/com.unity.addressables/[BuildTarget]).And then save it into cache.The next time open app,AAS will use the catalog in cache.

    The only way I found the AAS will download the catalog from http is you have to delete the catalog in StreamingAssets and build the apk to install.
    Because if there is no catalog in apk the AAS will download the catalog on http after it try to find catalog in apk and fail three times.
    But when AAS get the catalog on http it still save it into cache for the next time the app opening.

    So I think that's why the app can not update assets.
    Because when the AAS have cache once,it will always use it and seems not to check the new catalog on the http.

    Is it correct or something I missing?
    Waiting for the reply.

    Thanks.
    Merry Christmas!
     
    Last edited: Dec 24, 2018
    patcarver likes this.
  9. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Hello,
    Does someone have the same issue here?

    Still waiting...
     
  10. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    That flow seems correct. From your various updates, I can't quite tell exactly what problem you are currently facing. Can you post a summary with what exact steps you're doing (similar to this quoted flow) and what issue you're seeing? It sounds like we may be overly aggressive in our StreamingAssets self-cleanup, but I can't say for sure yet.

    -Bill
     
    MNNoxMortem likes this.
  11. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Hi,@unity_bill

    My problem is the addressable does not update on mobile.
    I found that assressable use the settings and catalog which build in apk and save it into cache.
    When I update bundle and upload to my http and reopen the app.
    The addressable still use the cache data and does not update from http.
    So it still use the origin settings and catalog,does not download the new data from http.

    In my view,the settings and catalog seems need to check and download from http.
    Because now use it in StreamingAssets.It can not be update except I rebuild a new apk.

    Do I missing something?
    Thanks for your replying.
     
    Last edited: Jan 18, 2019
  12. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    When you do the initial build, which has local assets and a local catalog, do you also have stuff on the remote server? From your description, it sounds like "no", which is the problem.

    When you build the player, we make a note of every known location that could hold a catalog in that player. Then as the player starts, it looks in all those known locations for new data. If you try to add a location after you have already built the player, the player won't know to look for new catalogs there. So if you ship a local-only game, you cannot set up a server and have the app figure out where that is after the fact.

    If you already have remote content when you build the player, then I probably need some additional details.
     
    MNNoxMortem likes this.
  13. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Hi,@unity_bill

    Here is my problem details.

    I set my asset upload_2019-1-19_10-12-28.png
    After initial build,I also upload those assets and catalog to remote server.
    Install app and open.It download the data from the remote server.
    Then the update build,I also upload the assets and catalog to remote server.
    And I reopen the app,it does not download the new assets.
    This is the problem I stuck.

    If the detail is not clear,tell me what the info you need.I will provide it ASAP.

    Thanks.
     
    Last edited: Jan 19, 2019
  14. unity_bill

    unity_bill

    Joined:
    Apr 11, 2017
    Posts:
    1,053
    So...
    - Initially, you do Build->Build Player Content. and you get a single bundle created from this group.
    - then you edit things
    - then you do Build->Prepare For Content Update using the new content state file.
    - this tells you what it's changing
    - then you do Build->Build For Content Update and end up with more than one bundle in your build path

    That sound right? If all that is happening, then please file a ticket through Unity's bug system so you can more easily attach a repro project for us.
     
    MNNoxMortem likes this.
  15. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    28
    Hi

    I already report to Unity's bug system(Case 1127299) and upload my test project.

    Thanks
     
  16. Nastomeya

    Nastomeya

    Joined:
    Mar 14, 2015
    Posts:
    9