Can Sentry be initialized in the Android Application class? If so, update docs
See original GitHub issueCurrently, the documentation suggests that Sentry should be initialized in Activity.onCreate
. However, if the application is ever started from a different Activity, this code will not be run. This code could be called from all of the activity entry points in the app but it’s easy to forget.
In theory, a preferable approach would be to initialize Sentry in Application.onCreate
, which runs before any Activities start. Is there any problem with doing this? If not, I’d recommend updating the docs to officially support this configuration.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Manual Initialization for Android - Sentry Documentation
Learn how to initialize the SDK manually when you need to provide additional configuration.
Read more >Advanced Usage for Android - Sentry Documentation
Sentry uses the AndroidX libraries for detecting when the Application is either in the background or in the foreground. This is necessary for...
Read more >Android - Docs - Sentry Documentation
The SDK can catch errors and crashes only after you've initialized it. So, we recommend calling SentryAndroid.init in the instance of the Application...
Read more >Where to put `sentry.properties` file in Android Studio project?
/app/src/main/kotlin. I initialize Sentry on start of my app in class that extends android.app.Application like so: class ...
Read more >Using Sentry - Expo Documentation
Sentry treats React Native as a first-class citizen and we have collaborated ... With expo-updates , release builds of both iOS and Android...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ninniuz I moved
sentry.properties
to<your-project>/<app-module>/src/main/resources/
, And now there is no warning. Thank you so much.@bruno-garcia Thank you for updating docs to configure Sentry in Application.
We’ve update the docs to use
Application
instead. https://docs.sentry.io/clients/java/integrations/#initialization