# Android app size and lib\_FoundationICU.so

**URL:** <https://forums.swift.org/t/android-app-size-and-lib-foundationicu-so/78399>\
**Category:** Android\
**Tags:** android, icu\
**Created:** [March 9, 2025, 5:26pm UTC](https://forums.swift.org/t/android-app-size-and-lib-foundationicu-so/78399 "2025-03-09T17:26:02Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![icharleshu](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/icharleshu/32/20905_2.png) [@icharleshu](https://forums.swift.org/u/icharleshu)\
**Post date:** [March 10, 2025, 10:06pm UTC](https://forums.swift.org/t/android-app-size-and-lib-foundationicu-so/78399/4 "2025-03-10T22:06:35Z")

</div>

> [@marcprux](#):
>
> - Reduce the size of `lib_FoundationICU.so`: most of the size of the library comes from the in the `icu_packaged_main_data.*.inc.h` header tables in [swift-foundation-icu/icuSources/common at main · swiftlang/swift-foundation-icu · GitHub](https://github.com/swiftlang/swift-foundation-icu/tree/main/icuSources/common). Could these be somehow compressed further? Or could a significant size reduction be realized by excluding some rare-but-large locales from that file? I haven't explored this option yet.
> - Support for dynamic thinning of ICU data: if an app only contains localization strings for 2 languages, then it might make sense to reduce the locale data to only support those languages. This would be a significant re-architecting of [swift-foundation-icu](https://github.com/swiftlang/swift-foundation-icu) to use external and removable resources rather than embedded `[uint8_t]` data.

IMO the best long-term approach would be to combine both methods, as it aligns well with the long-term goals of `SwiftFoundationICU`.

Currently, the `icu_packaged_main_data.*.inc.h` files are built from a prebuilt version of [Apple ICU](https://github.com/apple-oss-distributions/ICU). Ideally, in the future, we should build the data file as part of the SwiftPM build. This way, as you mentioned, we can also support optional thinning. However, I haven’t yet found a good way to “merge” the CMake-based build with the SPM build, which is why we’re currently using pre-built embedded files as an interim solution. I suspect the ultimate solution will involve rewriting the [ICU data build tool](https://unicode-org.github.io/icu/userguide/icu_data/buildtool.html) as a plugin, allowing it to be integrated into the SPM build.

---

_[View the full topic](https://forums.swift.org/t/android-app-size-and-lib-foundationicu-so/78399)._
