The documentation was not very helpful for me. Locations I've tried:
gradle.properties
and project's build.gradle
files reside)/app
folder (where app's build.gradle
file is localed)/app/src/main/kotlin
I initialize Sentry on start of my app in class that extends android.app.Application
like so:
class MyApp : Application() {
override fun onCreate() {
super.onCreate()
Sentry.init(AndroidSentryClientFactory(applicationContext))
}
}
And then do a test capture in one of my methods:
Sentry.capture("This is a test capture using Sentry")
I also tried to specify the path to sentry.properties
file explicitly in gradle.properties
with no luck.
When I use Sentry.init()
method that accepts DSN, it works, but this is not desired, because I do not want to check DSN into VCS.
I am aware of other methods of configuration, I just want to use sentry.properties
though.
There are in fact two different sentry.properties
files.
The sentry.properties
that is used by the app at runtime to configure the DSN should be placed at /app/src/main/resources
(documentation).
The sentry.properties
that is used at build time by Gradle to generate and upload ProGuard mappings to Sentry. This should be placed in the project root. (documentation). This is optional and only relevant for apps that use ProGuard.
I found out that
sentry.properties
file should be placed in the root directory of the app.
sentry.properties
in the same folder (its a same directory where you find AppName.iml, gradle.properties etc etc)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With