Announcement

Collapse
No announcement yet.

reducing apk size

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    reducing apk size

    Trying to reduce the apk size below 50megs so google play allows upload.
    I've found that when launching a level on device, apk has 'only' 23MB and rest of data is pushed directly to sd card without packaging. Looking at those files, my content takes only 10MB and rest (~$40MB) is 'Engine\Content' folder with stuff like default materials, editor icons and other irreleventness. Looks like this folder also get's packaged to apk in shipping mode because apk is bloated to +60MB.
    How do I get rid of this?

    #2
    Delete the extra stuff out of the project and it shouldn't push it into the apk.

    Comment


      #3
      Make sure "use OBB in APK" is unticketed in your Projects packaging settings. The APK will then be around 20meg and easily uploadable to play store. You then need to attach the OBB file separately (you may not see this option on the first upload but should see it after a refresh
      Headgear - VR/AR solutions

      Comment


        #4
        Originally posted by amorales2 View Post
        Delete the extra stuff out of the project and it shouldn't push it into the apk.
        I did. Those files are not from project folder.

        Originally posted by aussieburger View Post
        Make sure "use OBB in APK" is unticketed in your Projects packaging settings. The APK will then be around 20meg and easily uploadable to play store. You then need to attach the OBB file separately (you may not see this option on the first upload but should see it after a refresh
        Still it will include all the garbage for users to download

        Comment


          #5
          The workaround I used to make the OBB smaller as given in my answer here:
          https://answers.unrealengine.com/que...es-so-big.html

          Not pretty but works - see the game in my sig - managed to get the whole thing down to 35meg Wish the engine was better at not packing engine stuff that is not used to reduce the file size automatically!

          I managed to get the OBB size reduced a bit by manually deleting some slate folders from the engine folder before exporting as ETC1 (remembering to back them up and replacing them - else UE4 will no load the next time). There was also a ini setting that can be changed for another 3-5meg. Both of these tips I got from this thread:

          https://answers.unrealengine.com/que...43-and-42.html

          and I managed to get my game down to 35meg: https://play.google.com/store/apps/d....TappyFootball

          Also remember when ticking 'For Distribution' and selecting 'Shipping' after deploying the APK size drops to 15meg (from the 20 you get with all the developer debug stuff still in it). So my OBB which has a bit more than Tappy Chicken in it is 20meg and I got this by:

          Deleting these engine 2 folders remembering to back them up and replacing them - else UE4 will not load the next time!:

          Engine/\Content/\Slate/\Fonts

          Engine/\Content/\Slate/\Common

          and changing

          +ContentDirectories=/Engine/MobileResources

          to

          -ContentDirectories=/Engine/MobileResources

          in BaseEditor.ini in Engine/\Config

          Hope that helps you as well!

          When doing this with a blank project I got around 30meg total (APK and OBB)!
          Headgear - VR/AR solutions

          Comment


            #6
            I've seen that post before but didn't work for me, apk size went down but not below 50MB. Now I tried again and removed everything from slate folder except 'Docking' (build was failing without it) and it's 45MB.
            Packed with ETC1 only but good enough I guess, thanks

            Comment


              #7
              I have a question about size of files on android too so I will ask it on this thread if you don't mind

              I'm really a newbie in programmation so I was wondering if it was possible to cut in the source files of the Engine to remove all unused features ? In my case I only use unlit materials (a shame considering the graphical power of UE4, I know ^^) so could I simply go in the files concerning lightining and delete everything about light ? Would I save a significant amount of memory like this ?

              Comment


                #8
                https://youtu.be/_LhS171pggE

                Comment


                  #9
                  See this video:
                  https://youtu.be/_LhS171pggE

                  Comment


                    #10
                    Couldn't you just disable the Slate plugin in settings if you aren't using it, and it will compile without? Thought I read that somewhere in the past.

                    Unpopular Minion on the Play Store (Released: January 31, 2016)

                    Comment


                      #11
                      I reduced a lot(about 40%) changing the size of textures from 2048x2048 to 512x512

                      Comment


                        #12
                        Originally posted by carf View Post
                        I reduced a lot(about 40%) changing the size of textures from 2048x2048 to 512x512
                        How did you do that? Google search doesnt show me anything...

                        Comment


                          #13
                          Originally posted by OlMi1_YT View Post

                          How did you do that? Google search doesnt show me anything...
                          Double click on texture, you'll see "Compression settings"->"Maximum Texture Size"

                          Comment


                            #14
                            Just leaving it here https://damnow.blogspot.com/2018/12/...d-game-in.html
                            I was able to shrink "Third Person Template" APK+OBB to about 30MB.
                            The core idea is to remove absolutely everything you don't need - it includes plugins, engine modules, blacklisted content, debug symbols. Compressing content, sharing shader code and disabling movable lights also helps. The problem might be also the multiple architectures of the build, you might consider building only for arm64 devices these days.
                            Hope it'll help a little, cheers!

                            Comment

                            Working...
                            X