Commit 91405727 authored by Jonathan Almeida's avatar Jonathan Almeida Committed by Christian Sadilek
Browse files

Fix CrashReporter crash on using new API

parent b2779fd8
Loading
Loading
Loading
Loading
+30 −5
Original line number Diff line number Diff line
@@ -39,10 +39,35 @@ class MozillaSocorroService(
    }

    internal fun sendViaGeckoViewCrashReporter(crash: Crash.NativeCodeCrash) {
        // GeckoView Nightly introduced a breaking API change to the crash reporter that has not been uplifted to beta.
        // Since our CrashReporter does not follow the same abstractions as the engine, this results in
        // a `NoSuchMethodError` being thrown.
        // We should fix this in the future to make the crash reporter be part of the same engine extraction.
        // See: https://github.com/mozilla-mobile/android-components/issues/4052
        try {
            GeckoCrashReporter.sendCrashReport(
                applicationContext,
                File(crash.minidumpPath),
                File(crash.extrasPath),
            appName)
                appName
            )
        } catch (e: NoSuchMethodError) {
            val deprecatedMethod = GeckoCrashReporter::class.java.getDeclaredMethod(
                "sendCrashReport",
                Context::class.java,
                File::class.java,
                File::class.java,
                Boolean::class.java,
                String::class.java
            )
            deprecatedMethod.invoke(
                GeckoCrashReporter::class.java,
                applicationContext,
                File(crash.minidumpPath),
                File(crash.extrasPath),
                crash.minidumpSuccess,
                appName
            )
        }
    }
}
+4 −1
Original line number Diff line number Diff line
@@ -73,6 +73,9 @@ permalink: /changelog/
* **concept-sync**, **service-firefox-accounts**:
  * ⚠️ **This is a breaking change**: Added `OAuthAccount@disconnectAsync`, which replaced `DeviceConstellation@destroyCurrentDeviceAsync`.

* **lib-crash**
  * ⚠️ **Known issue**: Sending a crash using the `MozillaSocorroService` with GeckoView 69.0 or 68.0, will lead to a `NoSuchMethodError` when using this particular version of android components. See [#4052](https://github.com/mozilla-mobile/android-components/issues/4052).

# 6.0.2

* [Commits](https://github.com/mozilla-mobile/android-components/compare/v6.0.1...v6.0.2)