【发布时间】:2020-11-13 11:46:20
【问题描述】:
是否可以在每个活动中在 android 上自动发送错误/崩溃报告 或者它是完全手动的,我应该使用清单配置还是 sentry.properties,对不起,我是 Sentry 的新手,我使用了手动错误捕获,但可以自动进行
用于手动错误处理的现有代码
AndroidManifest.xml 配置
<meta-data android:name="io.sentry.dsn" android:value="dsn" />
MainActivity.kt
Sentry.init("dsn", AndroidSentryClientFactory(this.applicationContext))
try {
Log.d("sentrytest1","try")
throw Exception("This is a test.")
} catch (e: Exception) {
Log.d("sentrytest1","catch")
Sentry.capture(e)
}
【问题讨论】: