I’ve got a 6mb content game and the APK is 66mb… I’ve tried everything…no result, it doesn’t even go down 1mb.
What I’m trying now is the blacklist method to exclude all the engine default files which seem to be the cause, the problem is it isn’t working.
I’ve got the blacklist in the “projectname”/build/android folder and this is my list: link text
These are very big files and if it was working I should really see an improvement.
Any idea what I’m doing wrong? Seems pretty straight forward, I don’t know why it isn’t working
Hi SulXo,
- What platform are you developing for?
- What OS are you developing on?
- Have you tried everything on this link: Reducing APK Package Size
- Is your blacklist typed “camel-humped” like the example: PakBlacklist-Shipping.txt
Please review and follow any steps you have not already tried from the list above and let me know the results.
Thanks,
It’s for android and I’m developing on Windows 7, UE 4.13.
I did try everything on the documentation page yes, also some tips from other users, but still nothing.
And also yes, the txt file is written correctly (I just realised I messed up the question title, but file is ok)
Oh BTW, is everything in this directory what is actually packaged inside the APK?
“projectfolder”\Saved\Cooked\Android\Engine\Content
I can see there the stuff I’m trying to blacklist like the sky materials
EDIT: It may be worth mentioning in 4.12 apk was 50mb, then suddently in 4.13 it went to 66mb
Do you have the entire package log? You should see “Applying PAK blacklist file …” and “Excluding …” messages in the log.
We tested the PAK blacklist functionality with TappyChicken and it works fine; we got the messages in the log.
In addition to looking at the packaging log for the PAK blacklist entries, you can also try taking apart the two APK files and comparing the contents.
An APK is just a ZIP file so any ZIP extractor will open it. Look in the assets directory for main.obb.png and extract it. This is also a ZIP file, open it up and extract the PAK file.
UnrealPak.exe in the Engine/Binaries/Win64 directory can be used to get the list of files and sizes:
unrealpak mypakfile.pak -List
You can do this for both the 4.12 and 4.13 packages and see what is different.
…A few more thoughts, if you created the UE4.13 version of the project by making a copy of the UE4.12 version of the project, if you have not already, try right-clicking the Content folder in the Content Browser and selecing “fix up redirectors in folder.” Also do a map check for each level and make sure there are no errors. Finally, back up your Intermediate, Saved, and Config files and remove them from you project folder so that they are rebuilt anew when you reopen the project in UE4.13/
I extracted the pak file and I can confirm the files I want to get rid of are there. So the blacklist isn’t getting recognized.
In the 4.12, looking with 7-zip, both the lib folder and the engine content folder are about 10mb smaller. I’m guessing the size difference is the new content from 4.13 making it’s way into the apk even without being used.
There is no mention whatsoever to the blacklist in the package log.
I did the fix redirectors and I only have one map with one blueprint, I made the game like tappychicken, all in one. No apparent errors.
Although when looking at the reference viewer and navigating around I see stuff I’d never be using like VR and worldgrid materials, the sky materials as well, connected down the line to the level. But I don’t know if seeing them in the reference viewer means it’s actually using it.
Anyways the blacklist should just keep it out even if used.
I tried deleting the folders you said but that just destroys everything. I still have the assets but I have to reassign everything. So for now I just went back. I may try that if all else fails.
Ok, now something very weird is happening.
The blacklist is now working. I realized there is a bug on the project settings interface.
Normally when you check “For Distribution: True” the “build config” switches to shipping. But, at least in my case, every time I launch the editor the greyed out “build configuration” shows development instead of shipping (still having the For Distribution set on true).
As soon as I uncheck and recheck For Distribution, the build config switches back to shipping.
Now when packaging I can see the blacklist being taken (I only had the shipping blacklist). Size of the apk went to 38mb. Problem is it crashes on launch when I install it.
So, the blacklist works fine, it’s just that bug where I have to uncheck and check “for distribution”
I thought the crash might be one of the files I excluded, so I removed the blacklist. Now when I launch I can hear the game playing and even interact with buttons but the screen is completely black.
Then I tested a development build without blacklist for a 68mb apk and everything seems fine except for a button with alpha material that appears black.
There is definitely something going on between the dev build and the shipping build.
As my problem seems no longer related to blacklist I’ll set this as answered and post a new question.
Solved. In project settings/packaging the greyed out “build configuration” must match the blacklist name.
It is not automatically set to shipping when you launch the editor even when “For Distribution” is checked. You have to check and uncheck and it will reset itself. Some bug probably.
This thread is still one of the top search results for pak blacklisting, so I think it’s important to note that “PakBlacklist-Shipping.txt” and “PakBlacklist-Development.txt” are both deprecated in UE4/5 (since version v4.25 or so).
The above methods have been replaced with DefaultPakFileRules.ini.
Directions on how to set this up in the following post:
https://.unrealengine.com/t/pak-blacklist-file-deprecated-in-favor-of-defaultpakfilerules-ini/153080/5