Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deps] Add Back EventBus Android Dependency #153

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

ParaskP7
Copy link
Contributor

Description

This PR adds back the main EventBus dependency, which is Android related.

This dependency was incorrectly removed and replaced by its corresponding eventbus-java transitive dependency, assuming that is not required. However, after further testing it was revealed that this parent eventbus dependency, which is actually android specific is indeed necessary. If it is not provided on the classpath then an app will crash with the below runtime exception:

java.lang.RuntimeException: Unable to create application xyz: java.lang .RuntimeException:
It looks like you are using EventBus on Android, make sure to add the "eventbus" Android
library to your dependencies.

For more info see:

Testing Instructions

  1. Tooling:
    • Run the ./gradlew buildHealth task and verify that there is no unused related advise related to eventbus.
  2. Testing:
    • Quickly smoke test, either the JP/WPAndroid and/or WCAndroid, with this version of Utils, or via composite builds, and see if it works as expected.

This dependency was incorrectly removed and replaced by its
corresponding 'eventbus-java' transitive dependency, assuming that is
not required. However, after further testing it was revealed that this
parent 'eventbus' dependency, which is actually 'android' specific is
indeed necessary. If it is not provided on the classpath then an app
will crash with the below runtime exception:

------------------------------------------------------------------------

java.lang.RuntimeException: Unable to create application xyz: java.lang
.RuntimeException: It looks like you are using EventBus on Android,
make sure to add the "eventbus" Android library to your dependencies.

------------------------------------------------------------------------

For more info see:
- EventBus.register(...): https://github.com/greenrobot/EventBus/blob/
0194926b3bcf70cc0d7bfd3c5da16708dd5ab876/EventBus/src/org/greenrobot/
eventbus/EventBus.java#L143-L147
- !AndroidDependenciesDetector.areAndroidComponentsAvailable():
https://github.com/greenrobot/EventBus/blob/
0194926b3bcf70cc0d7bfd3c5da16708dd5ab876/EventBus/src/org/greenrobot/
eventbus/android/AndroidDependenciesDetector.java#L25-L36
@ParaskP7 ParaskP7 merged commit 3d7484a into trunk Sep 24, 2024
8 checks passed
@ParaskP7 ParaskP7 deleted the deps/add-back-eventbus-android-dependency branch September 24, 2024 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants