From 26fd71ef65b86327fe34899a4b7d16806b9aabe3 Mon Sep 17 00:00:00 2001 From: matsumo0922 Date: Mon, 14 Oct 2024 01:30:37 +0900 Subject: [PATCH] Fix app crash during bulk download and update version to 2.1.8. --- .../ui/src/commonMain/composeResources/files/versions.json | 7 +++++++ .../matsumo/fanbox/feature/service/DownloadPostService.kt | 7 ++++++- gradle/libs.versions.toml | 6 +++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/core/ui/src/commonMain/composeResources/files/versions.json b/core/ui/src/commonMain/composeResources/files/versions.json index ff2561d..0fd2131 100644 --- a/core/ui/src/commonMain/composeResources/files/versions.json +++ b/core/ui/src/commonMain/composeResources/files/versions.json @@ -173,5 +173,12 @@ "date": "2024/10/10", "logJp": "・ダウンロード中のUIを改善\n・ダウンロードしたファイルの保存先を指定できるように変更\n・常にオリジナルサイズの画像をダウンロードできるオプションを用意\n・大きなファイルをダウンロードした際にアプリがクラッシュする問題を修正", "logEn": "・Improved the UI during downloading\n・Changed so that you can specify the destination to save downloaded files\n・Option to always download images in their original size\n・Fixed issue where app would crash when downloading large files" + }, + { + "versionName": "2.1.8", + "versionCode": 48, + "date": "2024/10/14", + "logJp": "・一括ダウンロード中にアプリがクラッシュする問題を修正", + "logEn": "・Fixed an issue where the app would crash during bulk download." } ] diff --git a/feature/service/src/androidMain/kotlin/me/matsumo/fanbox/feature/service/DownloadPostService.kt b/feature/service/src/androidMain/kotlin/me/matsumo/fanbox/feature/service/DownloadPostService.kt index e21d925..398730d 100644 --- a/feature/service/src/androidMain/kotlin/me/matsumo/fanbox/feature/service/DownloadPostService.kt +++ b/feature/service/src/androidMain/kotlin/me/matsumo/fanbox/feature/service/DownloadPostService.kt @@ -75,7 +75,12 @@ class DownloadPostService : Service() { if (isForeground) { if (!this.isForeground) { Napier.d { "DownloadPostService start" } - startForeground(notifyConfig.notifyId, createNotify(baseContext, title, message, subMessage, progress)) + + runCatching { + startForeground(notifyConfig.notifyId, createNotify(baseContext, title, message, subMessage, progress)) + }.onFailure { + Napier.e(it) { "Failed to start foreground service. $title, $message" } + } } else { manager.notify(notifyConfig.notifyId, createNotify(baseContext, title, message, subMessage, progress)) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 130454c..93f579e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,7 +1,7 @@ [versions] # Application -versionName = "2.1.7" -versionCode = "46" +versionName = "2.1.8" +versionCode = "47" # SDK minSdk = "26" @@ -64,7 +64,7 @@ koin = "4.0.0" preCompose = "1.7.0-alpha02" # Others -ktor = "3.0.0-eap-1107" +ktor = "3.0.0" coil3 = "3.0.0-alpha10" ksoup = "0.1.2" composeWebView = "1.9.40-alpha01"