{"id":13659061,"url":"https://github.com/icerockdev/moko-crash-reporting","last_synced_at":"2025-08-11T07:38:11.527Z","repository":{"id":43355413,"uuid":"300198515","full_name":"icerockdev/moko-crash-reporting","owner":"icerockdev","description":"Fatal and Non-Fatal reporting to Crashlytics for Kotlin Multiplatform Mobile","archived":false,"fork":false,"pushed_at":"2022-12-18T11:28:54.000Z","size":178,"stargazers_count":28,"open_issues_count":5,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-10T12:43:12.347Z","etag":null,"topics":["android","crash-reporting","ios","kotlin","kotlin-multiplatform","kotlin-native","moko"],"latest_commit_sha":null,"homepage":"https://moko.icerock.dev/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icerockdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-01T08:07:37.000Z","updated_at":"2024-11-05T19:00:59.000Z","dependencies_parsed_at":"2023-01-29T19:02:44.800Z","dependency_job_id":null,"html_url":"https://github.com/icerockdev/moko-crash-reporting","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-crash-reporting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-crash-reporting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-crash-reporting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icerockdev%2Fmoko-crash-reporting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icerockdev","download_url":"https://codeload.github.com/icerockdev/moko-crash-reporting/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250619097,"owners_count":21460222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","crash-reporting","ios","kotlin","kotlin-multiplatform","kotlin-native","moko"],"created_at":"2024-08-02T05:01:04.949Z","updated_at":"2025-04-24T11:33:30.617Z","avatar_url":"https://github.com/icerockdev.png","language":"Kotlin","funding_links":[],"categories":["Libraries"],"sub_categories":["🔍 Analytics"],"readme":"![moko-crash-reporting](https://user-images.githubusercontent.com/701307/98647965-37858400-2368-11eb-98e8-6e62d75fa6af.png)\n[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0) [![Download](https://img.shields.io/maven-central/v/dev.icerock.moko/crash-reporting-core) ](https://repo1.maven.org/maven2/dev/icerock/moko/crash-reporting-core) ![kotlin-version](https://kotlin-version.aws.icerock.dev/kotlin-version?group=dev.icerock.moko\u0026name=crash-reporting-core)\n\n# Mobile Kotlin crash report\n\nThis is a Kotlin MultiPlatform library that provides reporting fatal and non-fatal exceptions from common code.\n\n## Table of Contents\n- [Features](#features)\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Samples](#samples)\n- [Set Up Locally](#set-up-locally)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n- **CrashlyticsLogger** implementation of **ExceptionLogger**, for logging messages and non-fatals to FirebaseCrashlytics.\n- **CrashReportingAntilog** can be used for **Napier** logger to log messages and errors by **ExceptionLogger**\n\n## Requirements\n- Gradle version 6.8+\n- Android API 19+\n- iOS version 11.0+\n\n## Installation\nroot build.gradle  \n```groovy\nallprojects {\n    repositories {\n        mavenCentral()\n    }\n}\n```\nproject build.gradle\n```groovy\ndependencies {\n    commonMainImplementation(\"dev.icerock.moko:crash-reporting-crashlytics:0.4.0\") // for CrashlyticsLogger\n    commonMainImplementation(\"dev.icerock.moko:crash-reporting-napier:0.4.0\") // for CrashReportingAntilog\n}\n```\nFor CrashlyticsLogger need to add FirebaseCrashlytics cocoapod\nWith [mobile-multiplatform-gradle-plugin](https://github.com/icerockdev/mobile-multiplatform-gradle-plugin) cocoapods configuration simplest:\n`build.gradle.kts`:\n```kotlin\ncocoaPods {\n    podsProject = file(\"ios-app/Pods/Pods.xcodeproj\")\n\n    pod(\"MCRCDynamicProxy\", onlyLink = true)\n}\n```\nproject Podfile\n```ruby\npod 'MCRCDynamicProxy', :git =\u003e 'https://github.com/icerockdev/moko-crash-reporting.git', :tag =\u003e 'release/0.4.0'\npod 'MCRCStaticReporter', :git =\u003e 'https://github.com/icerockdev/moko-crash-reporting.git', :tag =\u003e 'release/0.4.0'\n```\n\nOn iOS side add to `AppDelegate`:\n```swift\nimport FirebaseCore\nimport MCRCStaticReporter\n\n...\n\nfunc application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -\u003e Bool {\n    FirebaseApp.configure()\n    MokoFirebaseCrashlytics.setup()\n    ...\n}\n```\n\n## Usage\n\n### CrashlyticsLogger\nIf you haven't already, add Firebase to your project, you can see how to do it [here](https://firebase.google.com/docs/crashlytics/get-started)\n\n```kotlin\nval logger = CrashlyticsLogger()\n\n// setting user id in crashlytics \nlogger.setUserId(\"User_1\")\n\n// setting custom key-value in crashlytics \nlogger.setCustomValue(\"customValue\", \"customKey\")\n\n// log message in crashlytics\nlogger.log(\"Hello World\")\n\n// send non-fatal exception to crashlytics\ntry {\n    \"test\".toInt()\n} catch (e: NumberFormatException) {\n    logger.recordException(e)\n}\n```\n\n### CrashReportingAntilog\n```kotlin\nval logger = CrashlyticsLogger() // CrashlyticsLogger for example, you can use any ExceptionLogger implementation\n\n// initialize napier\nNapier.base(antilog = CrashReportingAntilog(exceptionLogger = logger))\n\n// All messages will be logged by exceptionLogger\nNapier.d(message = \"Hello World\")\nNapier.i(message = \"This is random message\", tag = \"FYI\")\nNapier.w(message = \"Something goes wrong\", tag = \"Alarm\")\nNapier.v(message = \"just verbose\", tag = \"VERBOSE\")\n\n// throwable will be recorded by exceptionLogger\ntry {\n    \"test\".toInt()\n} catch (e: NumberFormatException) {\n    Napier.e(message = \"test is not a number\", tag = \"Non fatal\", throwable = e)\n}\n```\n\n## Samples\nPlease see more examples in the [sample directory](sample).\n\n## Set Up Locally \n- The [crash-reporting-core](crash-reporting-core) contains basic classes and interfaces needed for crash reporting;\n- The [crash-reporting-crashlytics](crash-reporting-crashlytics) contains integraion with firebase crashlytics;\n- The [crash-reporting-napier](crash-reporting-napier) contains integration with [napier](https://github.com/AAkira/Napier) logger;\n- The [sample directory](sample) contains sample apps for Android and iOS; plus the mpp-library connected to the apps.\n\n\n## Contributing\nAll development (both new features and bug fixes) is performed in the `develop` branch. This way `master` always contains the sources of the most recently released version. Please send PRs with bug fixes to the `develop` branch. Documentation fixes in the markdown files are an exception to this rule. They are updated directly in `master`.\n\nThe `develop` branch is pushed to `master` on release.\n\nFor more details on contributing please see the [contributing guide](CONTRIBUTING.md).\n\n## License\n        \n    Copyright 2020 IceRock MAG Inc.\n    \n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n    \n       http://www.apache.org/licenses/LICENSE-2.0\n    \n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-crash-reporting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficerockdev%2Fmoko-crash-reporting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficerockdev%2Fmoko-crash-reporting/lists"}