Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

APK size remains same even after deleting objects!

Discussion in 'General Discussion' started by imDCStar, Mar 7, 2016.

  1. imDCStar

    imDCStar

    Joined:
    Nov 5, 2015
    Posts:
    2
    Hi,

    After completing the game. I found that APK size is big. i decided to delete some objects from the game. After deleting i build another APK. Objects deleted but size is same! I don't know the reason. i tried it several times. but no progress.
     
  2. undyingwill

    undyingwill

    Joined:
    Feb 3, 2016
    Posts:
    92
    That is a huge problem which Unity will not solve.
    Even if you delete everything in your project, apk will remain with same size, because the things are still in project after you delete them.

    If you want to remove them completely from your project search in store for package uninstaller is free and may work.
     
  3. imDCStar

    imDCStar

    Joined:
    Nov 5, 2015
    Posts:
    2
    Thanks. but it requires unity 5.3 i am using older version.
     
  4. dogmachris

    dogmachris

    Joined:
    Sep 15, 2014
    Posts:
    1,373
    contact the publisher and ask if he'll do a downgrade - some publishers do that, if asked (and if possible).
     
  5. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,353
    Are objects which have been removed, were used in game?

    If not, then the build size won't be affected, only project size. This is because Unity compiles only assets that the game uses.

    I have written an article on reducing build size for your games: http://appgoodies.net/unity/ways-to-squash-down-your-build-size/

    Some notable methods are to make a use of texture packing or downgrading the quality of sprites and sounds. Sometimes that helps!
     
    angrypenguin, Socrates and Ryiah like this.
  6. Teravisor

    Teravisor

    Joined:
    Dec 29, 2014
    Posts:
    654
    Um... That article doesn't include that all things in Resources folder and StreamingAssets get into build no matter if they're referenced or not. Sometimes developers forget that simple thing. ;)
     
    elmar1028 and Ryiah like this.
  7. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    What objects are you removing? Size mainly comes from assets. Sound and textures are particuarly big villains.

    Deleting GameObjects or scripts won't touch the build size. Not unless you manage to delete every reference to a specific asset in every scene.
     
    Schneider21 likes this.
  8. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,495
    This. You're blaming Unity, but not actually explaining the specifics of what you're doing. If you desire assistance then please be specific, and then someone might be able to help.

    Got an example of this?

    When you delete something from the project the files get removed from the project's folder. As long as that happens then it can't still be in the project, because the file isn't there to be read.
     
    Kiwasi likes this.
  9. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,353
    Thanks for feedback, I have added a new section that covers Special Folder Names. :D
     
  10. Tomnnn

    Tomnnn

    Joined:
    May 23, 2013
    Posts:
    4,148
    AAA mobile games - 20GB apks because of uncompressed audio in 100 languages.
     
  11. undyingwill

    undyingwill

    Joined:
    Feb 3, 2016
    Posts:
    92
    Yes, when i put asset which comes with tons of errors and delete it without package uninstaler i still have errors and cant start scene.
     
  12. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,495
    We cant help if all we know is that some "asset" was involved. Be specific.

    What asset?
    How did you install I, step by step?
    How did you remove it, step by step?
     
  13. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Thinking about it I encountered this problem with RAIN AI once. Imported the asset from the store window. Played around with it for a couple of hours. Realised it didn't meet my needs at the time. Deleted the folder for RAIN.

    Every time I opened the project it would reimport the RAIN dll from somewhere. I ended up moving everything across to a new project.

    Not sure how it did it, nor do I care. But there does seem to be potential for store assets to leave behind pieces of themselves if you simply delete the folder.

    It's unlikely to have much to do with final project size.