After convincing my team to switch from Crashlytics to Sentry, we immediately noticed one drawback: the Android APK size increased by nearly 2 MB. Considering our user base and Android's sensitivity to app size, this was a serious issue—every additional megabyte directly impacts download rates and conversions.
I started digging into the sentry-android GitHub repository to understand why the library was so heavy. Several discussions pointed out that enabling NDK support pulls in a large number of native files that many React Native apps simply don't need.
Fortunately, the documentation explains that if your app doesn't rely on NDK features, you can swap the dependency fromsentry-android to the lighter sentry-android-core.
To do this, I edited:
node_modules/@sentry/react-native/android/build.gradleThen changed the dependency:
implementation "io.sentry:sentry-android-core"Once the patch was created using patch-package and applied, a fresh build (with ./gradlew clean to clear caches) reduced our APK by approximately 1.2 MB.