Skip to content

Add Bugsnag #476

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ plugins {
alias(libs.plugins.emerge)
alias(libs.plugins.roborazzi)
alias(libs.plugins.androidx.room)
alias(libs.plugins.bugsnag.gradle)
}

val runningEnv: String? = System.getenv("RUNNING_ENV")
Expand Down Expand Up @@ -136,6 +137,7 @@ dependencies {
implementation(libs.androidx.browser)
implementation(libs.androidx.datastore)
implementation(libs.androidx.startup)
implementation(libs.bugsnag.android)

implementation(libs.extendedspans)

Expand Down
3 changes: 3 additions & 0 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
android:theme="@style/Theme.HackerNews"
tools:targetApi="31">

<meta-data android:name="com.bugsnag.android.API_KEY"
android:value="your-api-key-here"/>

<!-- This demonstrates manual initialization of Reaper.
See https://docs.emergetools.com/docs/reaper-setup-android#disable-automatic-initialization -->
<provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.emergetools.hackernews.data.remote.HackerNewsBaseClient
import com.emergetools.hackernews.data.remote.HackerNewsSearchClient
import com.emergetools.hackernews.data.remote.HackerNewsWebClient
import com.emergetools.reaper.Reaper
import com.bugsnag.android.Bugsnag
import kotlinx.serialization.json.Json
import okhttp3.OkHttpClient
import java.time.Duration
Expand All @@ -32,6 +33,8 @@ class HackerNewsApplication : Application() {
override fun onCreate() {
super.onCreate()

Bugsnag.start(this)

// This demonstrates manual initialization of Reaper.
// See https://docs.emergetools.com/docs/reaper-setup-android#manual-initialization
Reaper.init(applicationContext)
Expand Down
1 change: 1 addition & 0 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ plugins {
alias(libs.plugins.kotlin.ksp) apply false
alias(libs.plugins.roborazzi) apply false
alias(libs.plugins.androidx.room) apply false
alias(libs.plugins.bugsnag.gradle) apply false
}
7 changes: 5 additions & 2 deletions android/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jsoup = "1.20.1"
extendedspans = "1.4.0"
composeBom = "2025.04.01"
uiTestJunit4Android = "1.8.1"
bugsnag-android = "6.13.0"
bugsnag-gradle = "0.4.0"

[libraries]
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
Expand Down Expand Up @@ -73,7 +75,8 @@ roborazzi-rule = { group = "io.github.takahirom.roborazzi", name = "roborazzi-ju
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
androidx-ui-test-junit4-android = { group = "androidx.compose.ui", name = "ui-test-junit4-android", version.ref = "uiTestJunit4Android" }

bugsnag-android = { group = "com.bugsnag", name = "bugsnag-android", version.ref = "bugsnag-android"}

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
Expand All @@ -83,4 +86,4 @@ kotlin-ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
emerge = { id = "com.emergetools.android", version.ref = "emergePlugin" }
roborazzi = { id = "io.github.takahirom.roborazzi", version.ref = "roborazzi" }
androidx-room = { id = "androidx.room", version.ref = "room" }

bugsnag-gradle = { id = "com.bugsnag.gradle", version.ref = "bugsnag-gradle"}