Android app size and lib_FoundationICU.so

In the general case, they do need localization, but what percentage of apps will stick localized strings or time/date lookups in their natively compiled Swift code? Probably not many. You may want to default to a build setting that disables FoundationInternationalization altogether, so those who don't need localization/calendars in Swift can benefit from excluding it.

For those who need localization or other libicu-based APIs, this seems like your best bet to reduce app size due to native code. It would require figuring out exactly what APIs are in the most minimal official Android libicu, then only adding the missing "udat_*, unum_*, or ucurr_* needed for date/time formatting and parsing... any ucal_* calendar functions" plus ualoc_* back to your lib_FoundationICUAndroidNDK.so.

Only "~45% of devices" may have this system libicu.so, but the Play store has required that app updates target API 33 or later for the last six months. I don't know what type of backward compatibility they provide: have you looked to see if Play Services or some other system update also provides a libicu.so to older devices to keep such native code updates running?

I suspect that very few apps are doing localization or time/calendar lookups on the hot path, so I doubt performance will matter. But yeah, manually writing this bridging code, even based on JavaKit from swift-java, is probably not worth it.

This was discussed several years ago and eventually led to the work to bring Unicode tables into the stdlib and remove the libicu dependency there. Unfortunately, this has not been done for Foundation, but there were some ideas discussed in that earlier thread.

This seems like something you could immediately implement, ie have lib_FoundationICU.so load this data from a local file at first access rather than have it hard-coded in each arch-specific library. This would give you the biggest gain on Android for the least work and could likely be upstreamed back to Foundation, behind an optional build setting if nothing else.

Yep, once it is separated out, you could also add a tool for this.