CRASH REPORTER · 6 PLATFORMS

Know when your apps crash, and where

Add one small file to your app: every crash arrives in uBugtrack, grouped and counted, with its probable origin and a readable stack trace. One click turns it into a ticket.

Log in to get the crash key of your projectOpen the Crash Reporter ›
Crash Reporter
2.4.1372 min agosamsung SM-S921B
ExceptionIllegalStateExceptioncaused by NullPointerExceptionCoupon.kt:31
Checkout failed
java.lang.IllegalStateException: Checkout failed
at com.example.shop.CartActivity.onPay(CartActivity.kt:88)
5 framework frames
at android.view.View.performClick(View.java:7659)
at android.view.View.performClickInternal(View.java:7636)
at android.view.View$PerformClick.run(View.java:30156)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Looper.loop(Looper.java:222)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.String.length()' on a null object reference
at com.example.shop.cart.Coupon.apply(Coupon.kt:31)probable origin
at com.example.shop.CartActivity.onPay(CartActivity.kt:84)
... 5 more

How it works

  1. Add the library of your platform to your app (one file, no dependency) with the crash key of your project.
  2. Your app sends its crashes by itself: uncaught exceptions, fatal errors, unhandled promise rejections, warnings. A crash that could not be sent is sent at the next launch.
  3. Read them in the Crash Reporter: grouped by error, device and version, with the kind, the probable origin and a readable stack trace. Fix them, or turn them into tickets.
Every crash, automatically
Uncaught exceptions, fatal errors, warnings and promise rejections, sent by a small file in your app. No SDK, no dependency.
Grouped and counted
The same error on the same device and version is one line with its number of reports, the last one first.
Kind and origin at a glance
Fatal, exception or warning, the root cause, and the first line of your own code where it went wrong.
Readable stack traces
Colored like in your editor, the frames of Android, iOS, npm or vendor packages folded away.
Search and filters
Find a crash by message, class, file, device or version, keep only the fatal ones or the warnings.
One click to a ticket
Turn a crash into a ticket with the full report, from the website or the iPhone app.

Your crash key

Each project has its own crash key: the apps put it in their reports so that uBugtrack knows the project of a crash. It only allows to send crashes.

Log in or create a free account
Not a secret, but not for everyone. The key is inside your apps and web pages. If someone sends you fake crashes with it, create a new key and update your apps: the old one stops working at once.

Android

Android 5.0+Kotlin or JavaNo dependency
  1. Add one of the two files to your app module, in the package com.ubugtrack.
  2. Start it once, in your Application class:
    Kotlin
    class App : Application() {
        override fun onCreate() {
            super.onCreate()
            CrashReporter.init("YOUR_CRASH_KEY", this)
        }
    }
    Java
    public class App extends Application {
        @Override public void onCreate() {
            super.onCreate();
            CrashReporter.init("YOUR_CRASH_KEY", this);
        }
    }
  3. Declare the class and the Internet permission:
    AndroidManifest.xml
    <uses-permission android:name="android.permission.INTERNET" />
    
    <application android:name=".App" ...>
Reported: the uncaught exceptions of every thread, with their "Caused by". A crash is saved before it is sent: without network, it is sent at the next launch. Then the app ends as usual, so the crash still appears in the Play Console and in your other crash tools.

iOS & macOS

iOS 13+macOS 10.15+SwiftNo dependency
  1. Add the file to your app target.
  2. Start it once, when the app starts:
    SwiftUI
    @main
    struct ShopApp: App {
        init() {
            UbugtrackCrashReporter.start(crashKey: "YOUR_CRASH_KEY")
        }
    
        var body: some Scene {
            WindowGroup { ContentView() }
        }
    }
    UIKit
    func application(_ application: UIApplication,
        didFinishLaunchingWithOptions options:
        [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        UbugtrackCrashReporter.start(crashKey: "YOUR_CRASH_KEY")
        return true
    }
Reported: Objective-C exceptions and crashes (fatalError, force unwrap of nil, index out of range, bad memory access). The crash is saved when it happens and sent at the next launch; iOS still writes its own crash report. The version comes from your Info.plist.
Release builds strip the names of your functions: set Strip Style to Debugging Symbols in the build settings to keep them in the reports.

Web page

Every current browserJavaScriptOne file, no npm
  1. Add this line in the <head> of your pages, before your scripts (or serve the file with your site):
    HTML
    <script src="https://ubugtrack.com/download/ubugtrack_crashreport_browser.js"
            data-key="YOUR_CRASH_KEY" data-version="1.0.0"></script>
  2. Or, in an app built with Vite, webpack...: put the file in your sources and import it once, at the start of your app:
    main.js
    import './ubugtrack_crashreport_browser.js';
    
    window.ubugtrackCrashReport.initCrashReporter('YOUR_CRASH_KEY', '1.0.0');
Reported: uncaught errors and unhandled promise rejections, with the browser and the page (without its query string, which can hold tokens). The same error is sent once per page, and the errors of browser extensions are ignored.
The scripts of another site only give details with crossorigin="anonymous" on their tag. A Content Security Policy must allow https://ubugtrack.com in connect-src.

Node.js

Node.js 14+One file, no npmNo dependency
  1. Put the file in your project, with your other sources. Nothing to install: it has no dependency. From a terminal:
    Terminal
    curl -O https://ubugtrack.com/download/ubugtrack_crashreport_node.cjs
  2. Start it once, when your app starts:
    CommonJS (require)
    const ubugtrackCrashReport = require('./ubugtrack_crashreport_node.cjs');
    
    ubugtrackCrashReport.initCrashReporter('YOUR_CRASH_KEY', '1.0.0');
    ES modules (import)
    import ubugtrackCrashReport from './ubugtrack_crashreport_node.cjs';
    
    ubugtrackCrashReport.initCrashReporter('YOUR_CRASH_KEY', '1.0.0');

    The .cjs extension makes the same file work with require and with import. With TypeScript, put ubugtrack_crashreport_node.d.cts next to it.

  3. With Express, attach your app after your routes:
    server.js
    app.get('/cart', ...);
    
    ubugtrackCrashReport.attachExpress(app);
Reported: uncaught exceptions, unhandled promise rejections and warnings. The crash is sent before the process exits, like Node.js does it. An error you caught: ubugtrackCrashReport.report(error, 'what failed').

PHP

PHP 7.0 to 8.5curl or allow_url_fopen
  1. Add ubugtrack_crashreport.php to your project.
  2. Start it once, at the beginning of your scripts:
    index.php
    <?php
    require_once('ubugtrack_crashreport.php');
    initCrashReporter('YOUR_CRASH_KEY', '1.0.0');
Reported: warnings, uncaught exceptions and fatal errors (memory, time limit), with the URL or the script. PHP still logs and displays them as before, and the same error is sent once per request. An exception you caught: ubugtrack_report_exception($e).

Python

Python 3.8+No dependency
  1. Add the file to your project.
  2. Start it once, when your app starts:
    main.py
    from ubugtrack_crashreport import init_crash_reporter
    
    init_crash_reporter('YOUR_CRASH_KEY', '1.0.0')
  3. For a web app, wrap it too, so the errors come with their URL:
    Flask
    from ubugtrack_crashreport import UbugtrackWSGIMiddleware
    app.wsgi_app = UbugtrackWSGIMiddleware(app.wsgi_app)
    Django, wsgi.py
    from ubugtrack_crashreport import UbugtrackWSGIMiddleware
    application = UbugtrackWSGIMiddleware(
        get_wsgi_application())
    FastAPI
    from ubugtrack_crashreport import UbugtrackASGIMiddleware
    app.add_middleware(UbugtrackASGIMiddleware)
Reported: uncaught exceptions of the program and of its threads, and the errors of your web requests, with their chained exceptions. Python still prints them as before. An exception you caught: report_exception() inside except.

Questions

What is sent?

The error, its stack trace, the version of your app, the model of the device or the browser, its system, and the page or request that failed. Nothing about your users.

How are crashes grouped?

By error, device and version: the same crash again only adds to its counter and keeps the last log. Clear the old versions from the Crash Reporter once they are fixed.

How long are they kept?

A crash that was not reported again for 90 days is deleted. The log of a crash is cut at 2 KB.

Can I report an error I caught myself?

Yes: every library has a function for it, written in its section above.

How do I update a library?

Download its file again from this page and replace the one in your project. Each library is a single file with no dependency: there is no package manager to go through.