Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

[0.5.3] Update assets on mobile

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

  1. MomochaZ

    MomochaZ

    Joined:
    Jun 20, 2013
    Posts:
    23
    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

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    294
    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:
    23
    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:
    23
    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:
    23
    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:
    23
    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:
    23
    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:
    23
    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
  9. MomochaZ

    MomochaZ

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

    Still waiting...
     
  10. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    294
    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:
    23
    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 at 2:58 AM
  12. unity_bill

    unity_bill

    Unity Technologies

    Joined:
    Apr 11, 2017
    Posts:
    294
    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.