-
-
Notifications
You must be signed in to change notification settings - Fork 452
Initializing Sentry triggers a StrictMode violation #909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
hey @mshafrir-stripe thanks for raising this. after the method
similar issue on OkHttp repo square/okhttp#24 |
@mshafrir-stripe I can't reproduce it using API 23 and 29, do you get this on every run? looking at the Android CS: there's even a comment about that, but we use Could you use |
@marandaneto I'm still getting this with |
@mshafrir-stripe do you use Sentry on-premise or Sentry.io? as you have the release health feature enabled, if it's the on-premise, you'd need to be using the latest version, and this could be the way to reproduce the issue properly. |
I've tried using the same emulator and can't really reproduce it (using our sample in this repo). would you mind setting up a sample project that showcases this? or even just clone and try our sample in this repo and see if you get it. I only experience:
which is related to creating the caching folders
an OkHttp issue, but only a warning: square/okhttp#3537 |
hey @mshafrir-stripe did you have the time to set a sample project? I could not really reproduce it, otherwise only left me to close the issue, thanks :) |
I have the same issue. just need call to set tag. |
We're going to evaluate again which violations the SDK does and if it's possible to avoid them. |
Since there was no activity for over 3 years from the OP, and no new reports, I'm gonna close this |
As been mentioned in the linked OkHttp issue square/okhttp#3537, the issue is not really on OkHttp side. Users of OkHttp library are expected to set proper tags. Since Sentry is a user, Sentry should tag the calls it makes via OkHttp. And since Sentry is a library itself - Sentry should expose an API, which would allow its clients to tag Sentry network calls. |
@Lingviston opened #4340 to address, thanks for bumping this. You should be able to set you custom SocketTagger via We don't use OkHttp directly, but it comes transitively through Android who swaps the implementation of |
Would be nice to get a more specific API, as all I need is to add tag and keep everything else work the same. With a custom |
As mentioned, I'm not aware of a way to get the underlying socket besides reflection (which we're not going to pursue). If you know such a way please share with us and I will update the PR accordingly. Thanks! |
No no, the solution in the linked issue is fine. Thanks |
Platform:
compileSdkVersion
/targetSdkVersion
are set to30
IDE:
4.0
Build system:
6.5.1
Android Gradle Plugin:
4.0.0
Sentry Android Gradle Plugin:
1.7.35
Proguard/R8:
sentry-android installed with:
The version of sentry-android:
2.2.0
I have the following issue:
Initializing Sentry triggers a StrictMode violation
Steps to reproduce:
StrictMode
logging inApplication
subclassadb logcat -s StrictMode
Actual result:
Expected result:
StrictMode
violationThe text was updated successfully, but these errors were encountered: