Eventbus: AndroidX support

Created on 11 Oct 2018  ·  16Comments  ·  Source: greenrobot/EventBus

Now that Android Studio 3.2.0 and androidx 1.0.0 libraries have been released, is there a plan to migrate to androidx? Google has said there won't be any more feature releases under the android.support packaging.

Most helpful comment

In order to improve our build times (which are a pain point in our codebase), we're currently pushing to remove jetifier from our builds. This change has had two years to bake, and apart from the build speed wins we're excited to simplify our system by eliminating this legacy concern.

We don't directly rely on EventBus, but it is a transitive dependency used by a third party library we use. Unfortunately, jetifier cannot be selectively turned on and off for each individual project: it's either all or nothing. So EventBus is blocking this goal for us.

All 16 comments

Please refer to https://developer.android.com/jetpack/androidx/migrate on how to use AndroidX with libraries that do not yet use the new imports.

Keeping this open to track switching to AndroidX.
-ut

I've been having an issue with AndroidX whereby I get a NoClassDefFoundError when the find methods code walks down the inheritance tree.

A quick and dirty fix would be to filter for androidx packages in the moveToSuperclass() method. I've created a pull request for this, and it'd make sense from a performance perspective too.

AndroidX has been out for over a year now. Is there any update on this? This is the last non-AndroidX library in my project's external dependencies.

https://github.com/greenrobot/EventBus/releases/tag/V3.2.0

And the remaining code that uses the legacy Android Support Library APIs should not be used, anyhow (e.g. ErrorDialogManager).

@cckroets I use the latest release in an AndroidX project without issues. What is preventing you from doing so?

It requires enabling Jetifier which adds time to the build. It will analyze and re-write every external dependency to use AndroidX, which can be expensive for large projects.

Any plan to support AndroidX? Why the pull request is being ignored https://github.com/greenrobot/EventBus/pull/627 ?

We want to get rid of Jetifier which slows down builds, so is there a chance that EventBus will get migrated or should we rather remove it from our dependencies?

In order to improve our build times (which are a pain point in our codebase), we're currently pushing to remove jetifier from our builds. This change has had two years to bake, and apart from the build speed wins we're excited to simplify our system by eliminating this legacy concern.

We don't directly rely on EventBus, but it is a transitive dependency used by a third party library we use. Unfortunately, jetifier cannot be selectively turned on and off for each individual project: it's either all or nothing. So EventBus is blocking this goal for us.

And the remaining code that uses the legacy Android Support Library APIs should not be used, anyhow (e.g. ErrorDialogManager).

Then please release 3.3 removing those classed. It's high time!
We want to remove Jetifier for better build performance as well. EventBus is standing in the way.

Anybody there?
A month without answer. 2 years ignoring the problem.
We have now decided to remove EventBus from our project.

Sorry, busy with other things.

Using AndroidX would require making EventBus into an Android library (AAR), have not had time to look into resolving this (e.g. there still should be a plain Java version).

But should it really be available as plain Java? I know that it would be nice, but does the library have substantial amount of non-android users?

I do use this libary in my shared API and business logic module between my JVM Discord Bot and Android App. So this library should be kept compatible for plain Java in my opinion.
Unfortunately, my app takes between 2-10 minutes to build from scratch, and I want to reduce it by disabling Jetifier. But this library is one of the libs that still reference the old Android support libraries, which is sad.

maybe would be better to just remove all android dependencies, and make this library a pure java library. no need for jetifier or androidx then.

what is the plan for this?
the pull request with androidx conversion is ignored, would a pull request with conversion to pure java be welcomed? :D

@greenrobot @greenrobot-team

We decided to remove EventBus from our project.
Thanks for not caring, it was the reason we needed to get rid of this legacy dependency which is now considered a technical debt.

@pvegh sorry to hear that.

well I do care, I offered a solution, but they didn't respond.. :|

If they don't have time to maintain this library (or they don't even use it anymore) I am even willing to take over the responsability of maintaining the lib in the long run.. For me it's not a solution to abandon this library, since I use it extensively.

Anybody there @greenrobot-team ??

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kyze8439690 picture kyze8439690  ·  4Comments

ANewAnonymous picture ANewAnonymous  ·  4Comments

william-ferguson-au picture william-ferguson-au  ·  6Comments

liaohuyu picture liaohuyu  ·  4Comments

~
Liam6666 picture Liam6666  ·  5Comments