You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Android libsentry.so takes 209KB after compression: Can it be smaller? #700
You have the option of not tracking native crashes by installing sentry-android-core instead of sentry-android. That is because sentry-android brings in sentry-android-ndk which includes native libraries such as libsentry.so.
Sure, though I doubt there is any actionable thing we can do about code size right now. Unless we drop our custom fork of libunwindstack and rely on the system library, which only exists on fairly recent Android versions.
The upcoming sentry-java 9 removes libsentry.so from apps by default, so they no longer pay its size cost: sentry-android no longer depends on sentry-android-ndk in the 9.x.x branch:
Native crashes will be reported through tombstones on Android 12+ instead. Apps that need native crash reporting on older Android versions, or the NDK APIs, can still add io.sentry:sentry-android-ndk explicitly.
Activity
bruno-garcia commentedon Jul 26, 2021
You have the option of not tracking native crashes by installing
sentry-android-coreinstead ofsentry-android. That is becausesentry-androidbrings insentry-android-ndkwhich includes native libraries such aslibsentry.so.If that works for you, docs about how to do that are here: https://docs.sentry.io/platforms/android/using-ndk/#using-the-sdk-without-the-ndk
You wouldn't capture crashes from native libraries though.
/cc @getsentry/owners-native
fzyzcjy commentedon Jul 27, 2021
@bruno-garcia I have some c++ code so I need to capture the native crashes :/ is there any ways to shrink it?
marandaneto commentedon Aug 17, 2021
@fzyzcjy currently not, but you can pre-compile your own version of https://github.com/getsentry/sentry-native and remove features that are not used by your project.
fzyzcjy commentedon Aug 17, 2021
@marandaneto Thank you.
Swatinem commentedon Aug 17, 2021
its possible that some of the codesize comes from us vendoring a libunwindstack fork, which is heavy on c++, which is not known for small code size.
Anyhow, it is currently needed, otherwise you won’t have any stack traces. But we are looking into ways to improve that in the future.
fzyzcjy commentedon Aug 17, 2021
@Swatinem Thank you as well.
marandaneto commentedon Apr 13, 2022
@Swatinem can we transfer this issue to sentry-native since the Native bits live there? https://github.com/getsentry/sentry-native/tree/3436a29d839aa7437548be940ab62a85ca699635
Swatinem commentedon Apr 13, 2022
Sure, though I doubt there is any actionable thing we can do about code size right now. Unless we drop our custom fork of
libunwindstackand rely on the system library, which only exists on fairly recent Android versions.11 remaining items
jpnurmi commentedon Nov 5, 2026
The upcoming sentry-java 9 removes
libsentry.sofrom apps by default, so they no longer pay its size cost:sentry-androidno longer depends onsentry-android-ndkin the 9.x.x branch:Native crashes will be reported through tombstones on Android 12+ instead. Apps that need native crash reporting on older Android versions, or the NDK APIs, can still add
io.sentry:sentry-android-ndkexplicitly.