Fork of greenrobot/EventBus 3.3.1 with critical bug fixes for modern Android (API 35+, AndroidX, R8 full mode).
The upstream project is no longer actively maintained (last release Feb 2024, 147 open issues). This fork applies minimal, targeted patches to keep EventBus working with current Android toolchains.
SubscriberMethodFinder — fix NoClassDefFoundError during register():
- Check
@Subscribeannotation beforegetParameterTypes()to avoid unnecessary class loading for non-subscriber methods (based on PR #560) - Catch
NoClassDefFoundErroringetAnnotation()for methods referencing classes unavailable on the current API level (based on PR #293) - Catch
NoClassDefFoundErroringetParameterTypes()for methods with parameter types from newer API levels (e.g.PictureInPictureUiStateon API < 35,ComponentCalleron API < 35). See issue #737, issue #726 - Add null-check in
moveToSuperclass()aftergetSuperclass()(based on PR #560)
Available via JitPack.
Add the JitPack repository (if not already present):
// settings.gradle.kts
repositories {
maven(url = "https://jitpack.io")
}Android projects:
implementation("com.github.asamm.EventBus:eventbus:3.5.0")Java-only projects:
implementation("com.github.asamm.EventBus:eventbus-java:3.5.0")This library ships with embedded rules.
For general EventBus usage, see the original documentation.
Copyright (C) 2012-2021 Markus Junginger, greenrobot (https://greenrobot.org)
EventBus binaries and source code can be used according to the Apache License, Version 2.0.