ERROR: Failed to resolve: org.greenrobot:eventbus:2.4.0

1,192 阅读1分钟

build.gradle中引入eventbus2.4.0

implementation 'org.greenrobot:eventbus:2.4.0'

报错如下:

ERROR: Failed to resolve: org.greenrobot:eventbus:2.4.0

在https://mvnrepository.com/上搜索eventbus,发现3.0及以前版本的eventbus所属的group是de.greenrobot

3.0和3.1所属的group是org.greenrobot

所以要引入2.4.0版本可以使用以下方法:

implementation 'de.greenrobot:eventbus:2.4.0'