Search Unity

Unity 5.3.4 - Could not open file assets/bin/Data/sharedassets0.assets.resS for read

Discussion in 'Android' started by kromenak, Mar 24, 2016.

  1. kromenak

    kromenak

    Joined:
    Feb 9, 2011
    Posts:
    270
    I recently started noticing this spam in the adb logcat for our game when it's launching:

    E/Unity (23115): Could not open file /data/app/com.mycompany.myapp-1/base.apk/assets/bin/Data/sharedassets0.assets.resS for read

    Which, you know, is somewhat concerning. The game seems to run OK, but some assets are missing, and just show up as black rectangles. Not *a ton* of assets, but enough for the game to look busted.

    I wanted to find a way to see if this asset actually exists, so I renamed my APK to ZIP format, unzipped it, and checked in the assets/bin/Data folder. Sure enough, I see a ton of files each 1MB, named "sharedassets0.assets.split[0-102], but no asset named sharedassets0.assets.resS.

    So, are the sharedassets not being properly assembled for some reason? What can I do on my end to debug the issue? Is there some adjustment I can make in Unity to fix the problem?
     
  2. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    That sounds really bad. Can you please file a bug on the issue? I don't have the code in front of me but I think that resS file normally contains streamed textures.

    What you could try to do as a workaround, assuming a normal rebuild of the APK doesn't fix the issue, is to put a dummy scene as the first level.
     
  3. kromenak

    kromenak

    Joined:
    Feb 9, 2011
    Posts:
    270
    Hi, thanks for the reply! I tried a normal rebuild, and also using a dummy scene as the first level, but that didn't seem to make a difference in the inclusion of the assets.resS file.

    Oddly enough, our build machine kicked off a build that DID build correctly, so potentially, ideally, there's a local issue with my checkout of the project that can be sorted by maybe deleting my library folder or something.

    I'd be happy to file a bug, but I don't know that I'd be able to include the entire project (it's quite large, about 2.5GB). Also, considering that it seems to work OK on another machine, I don't know how reproducible it would be.

    Perhaps this is related to the issue, but when I build on my machine, I get a peculiar build size summary:
    Textures 333.2 mb 60.9%
    Meshes 6.8 mb 1.2%
    Animations 1.7 mb 0.3%
    Sounds 208.2 mb 38.1%
    Shaders 90.8 kb 0.0%

    Other Assets -35162.2 kb -6.3%
    Levels 971.8 kb 0.2%
    Scripts 2.4 mb 0.4%
    Included DLLs 3.9 mb 0.7%
    File headers 24.0 mb 4.4%
    Complete size 546.8 mb 100.0%


    I checked our build machine and saw that it has a more reasonable build size summary:
    Textures 290.3 mb 53.3%
    Meshes 6.8 mb 1.2%
    Animations 1.7 mb 0.3%
    Sounds 208.2 mb 38.2%
    Shaders 90.8 kb 0.0%
    Other Assets 6.2 mb 1.1%
    Levels 971.8 kb 0.2%
    Scripts 2.4 mb 0.4%
    Included DLLs 3.9 mb 0.7%
    File headers 24.0 mb 4.4%
    Complete size 544.5 mb 100.0%

    There's clearly some odd discrepancy there (different texture sizes and obviously the weird negative "Other Assets" print out). I'll see if doing a fresh import fixes the issue.
     
  4. kromenak

    kromenak

    Joined:
    Feb 9, 2011
    Posts:
    270
    Hah! So, oddly, simply restarting the Unity editor ultimately fixed this issue for me. I believe that the wonky "Other Assets" size is related to the general issue, but it must be triggered by some runtime action within Unity that is fixed when you restart the editor.
     
  5. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    I get this occasionally too. It's in particular one A8 texture that contains my 2d light sprites. Reimporting that texture and rebuilding APK fixes the issue, but it's still annoying to always check that the lights indeed work before submitting a build.. I thought streaming assets were disabled on Android anyway?
     
  6. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    131
    We have exactly the same problem with our Sprite Packer atlases. If we make a build on iOS and then switch to Android, the Android build will randomly will be with broken textures, not all of them, but a random chunk.
     
  7. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    Yeah it definitely has something to do with platform change. Always always when I change from Standalone to Android that one light texture is broken, until I reimport it. It's a bit worrying; there are now two problems when changing build targets: this and the sprite atlas breaking down, requiring me to delete AtlasCache and restart Unity. :/
     
  8. bitter

    bitter

    Unity Technologies

    Joined:
    Jan 11, 2012
    Posts:
    530
    @kromenak glad it worked out!

    thread: If any of you can submit a small case to reproduce the broken textures / atlases on a platform switch that would be great! If you do please let me know the case number you were assigned.
     
  9. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    @bitter I have a separate thread for the atlas issue here, but I've been unable to actually reproduce it in a fresh project.. Even with the exact same sprites and settings. :(
     
    Last edited: Mar 29, 2016
  10. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    I got the same "could not open file sharedassets" bug, but i am working on webGL + linux.
    As i understood, the bug is generated when switching plateforms right ? wich i do every time when i compile for webGL and linux.
    How do you proceed then ? you switch platform then restart ?
     
  11. mh114

    mh114

    Joined:
    Nov 17, 2013
    Posts:
    295
    If you can figure out which textures/assets break when that error appears, you can just reimport those and rebuild. For me it's always the one A8 lights sprite texture.
     
  12. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    I fact, i cant figure out what breaks the asset...it is in the build only ...and developpement build dont give me any informations.
     
  13. khreathor

    khreathor

    Joined:
    Jan 29, 2014
    Posts:
    6
    Hey guys!
    I have solution for specific scenario, but maybe it will help to solve other problems too.
    I had the same problem: "Could not open file something_something/sharedassets0.assets.resS for read" when I was loading scene from asset bundle. Sometimes it loaded but with broken Font, so i thought it's a Font problem... and it was!

    My fonts were converted to Custom Font (the one with material and Alpha 8 texture with letters) and by default material had GUI/TextShader which caused crash! When I changed it to UI/Unlit/Text it worked!

    I think maybe GUI/TextShader is somehow excluded from shared assets? Maybe it's considered as an Editor part? I'm just guessing.

    Hope it will somehow help few people.
    Cheers!
     
  14. georgiksk

    georgiksk

    Joined:
    Oct 1, 2016
    Posts:
    1
    Hi.

    I can confirm that restart of Unity 5.4.1f1 fix the issue. The problem started to occur after I have added Text on the stage, but then I removed the object. May be there is correlation between bug and font as described by khreathor.

    How to reproduce problem:
    - build project for Desktop - everything works
    - switch to WebGL version and build it in developer mode

    Workaround:
    - build project for Desktop
    - switch to WebGL build
    - exit Unity Editor and start it again
    - build WebGL project

    Here is the sample project in ZIP file: http://georgik.sinusgear.com/wp-content/html5/siriel/bugs/siriel-issue-with-webgl-build.zip

    Here is the build of application:
    - before restart: http://georgik.sinusgear.com/wp-content/html5/siriel/0.4.1/index.html
    - after restart: http://georgik.sinusgear.com/wp-content/html5/siriel/0.4.2/index.html

    Update:
    The very same problem appears on Android. Assets on Android are visible only as black box, after switching the target platform.
    Issue reported to Unity team via Unity Editor Bug reporter.

    Update 9 Oct. 2016:
    I have received mail from Unity QA that they were not able to simulate such a bug and that I should try to use DX9. In my opinion this bug has no relation to Direct X, because same behavior appears on Linux. I sent them my insights, but they didn't respond.
     
    Last edited: Oct 9, 2016
    kreso likes this.
  15. Filipinjo

    Filipinjo

    Joined:
    Jan 7, 2014
    Posts:
    22
    Same problem here :/ Black box in webgl build.
     
  16. Ultraspider

    Ultraspider

    Joined:
    Apr 22, 2013
    Posts:
    18
    I just had the same issue on an Android build.
    Restarting Unity solved the issue.
    Unity version 5.4.2f2
     
  17. Julien-Lynge

    Julien-Lynge

    Joined:
    Nov 5, 2010
    Posts:
    142
    An update:
    We were seeing this same issue in 5.5, with a rather large project (multiple gigabytes). It started happening after we did a large bake, which had a few issues - not sure if there's any relation.

    When attempting to open the project, we saw the issue where Unity said it could not find sharedassets0. Then, when we attempted to open any scene or to switch the platform (we tried win32 to win64) Unity would hang indefinitely with 0% CPU used.

    When we removed the Fonts folder, the project started working - we were able to switch platforms and load scenes again. I'm currently going through the fonts folder and trying to figure out what's going on. We have a few different ttf fonts and are using TextMesh Pro, so we have some SDF assets in there too.
     
  18. Storm4_

    Storm4_

    Joined:
    Mar 2, 2016
    Posts:
    14
    Just had this issue in 5.5 too. I saved the scene yesterday, and today when I tried to open unity, it hanged indefinitely. I had no idea what was that and tried to open different scenes. Later I found out that this bug happens whenever I even select a specific character's prefab. Then, I tried to select some textures containing the character sprites, and finally this error started to appear (sometimes just hanging like before without an error). Reimporting all the broken textures manually fixed my problem.

    It might be related to me occasinally moving a tree of folders with the textures into another folder, and then pressing undo, or to changing those textures compression quality, however I did this to other textures too, and they looked fine. I did not switch platforms (standalone).
     
  19. Amir-Ward

    Amir-Ward

    Joined:
    Jan 26, 2015
    Posts:
    30
    Getting this problem on hololens builds with 2019.1.3 all of the suggested fixes above do not work