Blankj/AndroidUtilCode · error · Exception
These buses is not right: " + wrongBus + "\n u can check it
Error message
These buses is not right: " + wrongBus + "\n u can check it in file: " + jsonFile.toString()
What it means
BusClassVisitor records isParamSizeNoMoreThanOne for each @BusUtils.Bus method and flips it false once the parameter count exceeds 1. After scanning, methods with > 1 parameter are collected into wrongBus. BusUtils only supports zero- or one-parameter subscribers (post(tag) or post(tag, arg)). If wrongBus is non-empty and ext.abortOnError is true (default), it throws Exception listing the offenders and pointing at __bus__.json.
Source
Thrown at plugin/bus-gradle-plugin/src/main/java/com/blankj/bus/BusPlugin.groovy:122
}
if (!rightInfoString.isEmpty()) {
rightBus.put(tag, rightInfoString)
}
if (!wrongInfoString.isEmpty()) {
wrongBus.put(tag, wrongInfoString)
}
}
Map busDetails = [:]
busDetails.put("BusUtilsClass", ext.busUtilsClass)
busDetails.put("rightBus", rightBus)
busDetails.put("wrongBus", wrongBus)
String busJson = JsonUtils.getFormatJson(busDetails)
log(jsonFile.toString() + ": " + busJson)
FileUtils.write(jsonFile, busJson)
if (wrongBus.size() > 0) {
if (ext.abortOnError) {
throw new Exception("These buses is not right: " + wrongBus +
"\n u can check it in file: " + jsonFile.toString())
}
}
BusInject.start(busMap, busUtilsTransformFile, ext.busUtilsClass)
}
} else {
throw new Exception("No BusUtils of ${ext.busUtilsClass} in $mProject.")
}
}
}View on GitHub (pinned to 7b4caf9e54)
Solutions
- Reduce the annotated method to zero or one parameter.
- If multiple values are needed, wrap them in one parameter type and post that object via BusUtils.post(tag, wrapper).
- Temporarily set abortOnError = false to allow the build (the offending bus is simply not registered/injected; use only for diagnostics).
Example fix
// before - subscriber has 2 params -> "These buses is not right"
@BusUtils.Bus(tag = "update_profile")
public void onUpdate(String name, int age) { /* ... */ }
// after - at most one param; wrap multiple values in a bean
public class ProfileUpdate {
public final String name;
public final int age;
public ProfileUpdate(String name, int age) { this.name = name; this.age = age; }
}
@BusUtils.Bus(tag = "update_profile")
public void onUpdate(ProfileUpdate update) { /* ... */ }
// post with: BusUtils.post("update_profile", new ProfileUpdate("neo", 42)); Defensive patterns
Strategy: validation
Prevention
- Every @BusUtils.Bus method must take 0 or 1 parameter.
- Bundle multiple values into a single bean object posted as the one arg.
- Inspect the generated __bus__.json after each build to catch wrongBus entries early.
When it happens
Trigger: A method annotated @BusUtils.Bus is declared with two or more parameters, e.g. @BusUtils.Bus(tag = "x") void fun(String a, int b); BusUtils has no way to deliver multiple args by tag.
Common situations: Refactoring a subscriber to take an extra context/flag parameter; copy-pasting from an EventBus-style signature; misunderstanding that BusUtils passes at most a single optional arg keyed by tag.
Related errors
- No BusUtils of ${ext.busUtilsClass} in $mProject.
- <" + className + "> and <" + apiInfo.implApiClass + "> impl
- u should impl these apis: " + noImplApis + "\n u can check i
- No ApiUtils of ${apiUtilsClass} in $mProject.
- BusExtension's busUtilsClass is empty.
AI-assisted analysis of Blankj/AndroidUtilCode@7b4caf9e54 (2026-08-14).
Data as JSON: /api/errors/574f8b70d6b16051.
Report an issue: GitHub.