We also noticed that the app is also building for x86. We should remove this since nodejs-mobile removed support for that architecture completely.
So with this in mind, some actionable items/conclusions:
Definitely want to:
remove x86 target completely (via custom config plugin). this should shave off at least 33 MB from the APK
purge unneeded files that live in the native node assets directories (trivial-ish)
minify backend JS bundle (trivial)
minify client JS bundle (trivial)
Possibly:
set enableLegacyPackaging to true (probably not but worth looking into). at the very least, check to see if this is the reason the native libs are much larger now (compared to Mapeo Mobile)
figure out how to enable minification via R8 (difficult, probably)
Some items based on initial investigations (with some help from @EvanHahn ):
The native library sizes are significantly larger in CoMapeo than Mapeo (about 4x), with nodejs-mobile representing the vast majority of that size. my hunch is that it's related to changes introduced via the android gradle plugin around native libs (see https://stackoverflow.com/questions/62440105/apk-size-increased-35mb-when-bumping-min-sdk-from-21-to-24/63417612#63417612 and https://developer.android.com/build/releases/past-releases/agp-4-2-0-release-notes#compress-native-libs-dsl), but have yet to confirm that.
We also noticed that the app is also building for x86. We should remove this since nodejs-mobile removed support for that architecture completely.
So with this in mind, some actionable items/conclusions:
Definitely want to:
Possibly:
enableLegacyPackaging
totrue
(probably not but worth looking into). at the very least, check to see if this is the reason the native libs are much larger now (compared to Mapeo Mobile)