Search Issue Tracker

Won't Fix

Votes

1

Found in [Package]

1.0.3

Issue ID

LOC-432

Regression

Yes

[Localization][Android] The .apk file size increases when building project with Localization package

Package: Localization

-

Reproduction steps:
1. Open the attached project "Bug.zip"
2. Go to File > Build Settings
3. Select Android Platform
4. Build the project
5. Go to the project folder and observe the .apk file size
6. In the project folder go to Assets and delete "Localizzazione" folder
7. Go back to the Editor
8. Build the project for Android
9. Go to the project folder and observe the .apk file size

Expected result: The .apk file size does not increase
Actual result: The .apk file size increase by 10MB

Reproducible with: 1.0.3 (2020.3.15f1, 2020.3.20f1, 2021.1.25f1, 2022.1.0a11)
Not reproducible with: 1.0.3 (2019.4.31f1, 2020.1.0a1, 2020.1.0a25, 2020.2.0a21)
Could not test with: 2021.2.0b15 (The project does not build), 2020.1.0b15, 2020.3.0f1 - 2020.3.14f1 (Building failure)

Notes:
- Issue is reproducible when building for Android
- Issue is not reproducible when building for Standalone
- The .apk file size increases to 26MB - 35.9MB with the Localization package
- When building project with 2019.4.31f1 Unity version, 1.0.3 Localization package version, with and without package .apk file size is 15.5MB
- Issue is reproducible with both 1.0.1 and 1.0.3 Localization package versions

  1. Resolution Note:

    After further investigation, we have found that the increase is predominantly caused by the localization package dependencies.

    The biggest increase comes from Newtonsoft.Json.Linq;
    It is causing an increase of around 7-8 mb.
    Text mesh pro is causing 500kb~.
    Addressables and others are causing 2mb~.

    When building on IL2CPP with simple usage. After some research, it appears to be a known fact that Newtosoft grows big in AOT-compilation because of its generic handling.
    There is no short-term solution we can do on the Newtonsoft side. We plan to investigate some solutions that could help with that though but can't provide a timeline for it.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.