AndroidUtilCode
AndroidUtilCode copied to clipboard
BusUtils: The bus of tag <xxxx> is not exists
描述 Bug
简洁地描述下 Bug。
- AndroidUtilCode 的版本: implementation 'com.blankj:utilcodex:1.31.1'
- 出现 Bug 的设备型号:MI10S
- 设备的 Android 版本: API 30
- kotlin 版本:1.6.10
相关代码
//发送通知
BusUtils.post(Constants.BACK_TO_MAIN_TAG)
//接受通知
@BusUtils.Bus(tag = Constants.BACK_TO_MAIN_TAG)
fun backToMain(){
mViewBind.viewPage.currentItem = 0
}
已全部配置 插件 也生成 了 bus.json 文件
{
"BusUtilsClass": "com.blankj.utilcode.util.BusUtils",
"rightBus": {
"back_to_main_tag": [
"{ desc: com.example.tomatocloud.ui.activity.MainActivity#backToMain() }"
],
"back_to_record_tag": [
"{ desc: com.example.tomatocloud.ui.fragment.record.RecordFragment#backToRecord(java.lang.String order) }"
]
},
"wrongBus": {}
}
异常堆栈
BusUtils: The BusInfo { tag : back_to_main_tag, desc: com.example.tomatocloud.ui.activity.MainActivity#backToMain(), sticky: false, threadMode: POSTING, method: public final void com.example.tomatocloud.ui.activity.MainActivity.backToMain(), priority: 0 } was not registered before.