Open fzyzcjy opened 3 years ago
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
.
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
@bruno-garcia I have some c++ code so I need to capture the native crashes :/ is there any ways to shrink it?
@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.
@marandaneto Thank you.
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.
@Swatinem Thank you as well.
@Swatinem can we transfer this issue to sentry-native since the Native bits live there? https://github.com/getsentry/sentry-native/tree/3436a29d839aa7437548be940ab62a85ca699635
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.
Leaving this here as breadcrumbs:
libunwindstack was first introduced in API level 28.
Also, https://android.googlesource.com/platform/bionic/+/master/docs/status.md
New libc functions in T (API level 33): backtrace, backtrace_symbols, backtrace_symbols_fd (
).
So once we raise our minimum supported API level to 28, we can drop our custom libunwindstack
fork. Which should cut down the code size by quite a bit (though I never measured that; but I suspect it amounts to a large chunk). And probably using the system provided version might also yield better quality stack traces. 🎉
But alas, backwards compatibility prevents us from having nice things.
What we could probably do now is make mpack serialization an opt-out feature. Its only used actively with the crashpad backend, but it is part of the public API for reasons. Making it opt-out would mean we are still API compatible, but give people the opportunity to remove that probably unused chunk of code.
Another thing worth mentioning:
New libc functions in L (API level 21):
dl_iterate_phdr.
That would make it possible to get rid of our custom module finder, which has caused pain over and over again; and getting rid of that would also gain us some code-size wins.
Platform:
IDE:
Build system:
Android Gradle Plugin:
Sentry Android Gradle Plugin:
Proguard/R8:
Platform installed with:
The version of the SDK: latest
I have the following issue:
When looking at my output apk, I see libsentry.so takes 209KB after compression. Can it be smaller? Thank you!
Steps to reproduce:
Actual result:
Expected result: