Ghasem Shirdel
07/24/2025, 5:24 PMArtem Olkov
07/24/2025, 5:51 PMGhasem Shirdel
07/24/2025, 6:42 PMbuild/xcode-frameworks
folder, and also checked the final product installed on the simulator from the Products
folder.
According to Apple’s documentation and issue tracker, this might not be the correct way to measure the actual app size.
Regarding the module I’m integrating with iOS — I didn’t use the term “export” specifically. But there is one key difference:
My module links against a .a
library (libsodium
) and also includes a custom library I built via cross-compiling (C++ and Objective-C++), so I’m using the dynamic framework approach (isStatic = false
) to handle this. The shared module is being linked dynamically.
Could this use of dynamic linking be the reason for the increased size?
Also, for some context, here’s how my module structure looks:
iosApp -> shared -> cppModule
In
cppModule
, I have a Kotlin wrapper around native functions that I exported to Kotlin Native using @CName
and def
files.
Both shared
and cppModule
have linkerOpts
pointing to .a
files, and both are configured with isStatic = false
.
I remember that when I tried setting them to isStatic = true
, I encountered runtime errors.
Is there any way to fix this so I can use static linking and potentially reduce the final size?Ghasem Shirdel
07/24/2025, 6:42 PMGhasem Shirdel
07/24/2025, 8:15 PMshared
module, they had two options:
1. Using Swift Package Manager (SPM):
2. The iOS app would dynamically load the binaries, and SPM would fetch the prebuilt .a
Objective-C Sentry binaries (via CocoaPods integration).
3. Using CocoaPods directly inside the shared
module:
4. This allowed the shared module to download the .a
files at build time and handle the linking internally.Artem Olkov
07/25/2025, 5:26 AMIs there any way to fix this so I can use static linking and potentially reduce the final size?Please open a youtrack ticket with a reproducer for that case(static library compilation with CExport produces runtime errors), so that the team could investigate properly 🙂
Ghasem Shirdel
07/25/2025, 11:41 AM