Blankj/AndroidUtilCode · error · Exception
No BusUtils of ${ext.busUtilsClass} in $mProject.
Error message
No BusUtils of ${ext.busUtilsClass} in $mProject. What it means
BusPlugin sets busUtilsTransformFile only in scanClassFile(), when it encounters a class whose name equals busUtilsClass. In onScanFinished(), if busUtilsTransformFile is still null (the class was never seen), it throws Exception. There is nothing to inject the event registry into, so the build cannot proceed.
Source
Thrown at plugin/bus-gradle-plugin/src/main/java/com/blankj/bus/BusPlugin.groovy:130
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
- Ensure the dependency providing busUtilsClass is on the app classpath, e.g. api 'com.blankj:utilcode:latest.release'.
- Verify busUtilsClass exactly matches the FQN of the BusUtils class present (correct package, no typo).
- If using onlyScanLibRegex/jumpScanLibRegex, make sure the jar/module containing BusUtils is not excluded (utilcode is never skipped by isIgnoreScan).
Example fix
// before - busUtilsClass names a class not on the classpath
bus { busUtilsClass "com.example.MyBusUtils" } // missing -> "No BusUtils of ..."
// after - provide the dependency / correct class
dependencies { api 'com.blankj:utilcode:latest.release' }
bus { busUtilsClass "com.blankj.utilcode.util.BusUtils" } // or omit the block Defensive patterns
Strategy: validation
Prevention
- Always include the dependency that hosts the configured BusUtils class (utilcode by default).
- Double-check the busUtilsClass FQN against the actual class package/name.
- Avoid scan-regex rules that would exclude the jar containing BusUtils.
When it happens
Trigger: busUtilsClass names a class not present on the app's compiled classpath; the BusUtils class lives in a jar excluded by onlyScanLibRegex/jumpScanLibRegex; the utilcode dependency is not actually pulled in; the FQN has a typo or wrong package.
Common situations: Configured busUtilsClass "com.xxx.xxx.BusUtils" for a custom copy but the dependency providing it is missing; forgot to add api "com.blankj:utilcode:..."; the BusUtils jar is filtered out by a scan regex.
Related errors
- No ApiUtils of ${apiUtilsClass} in $mProject.
- These buses is not right: " + wrongBus + "\n u can check it
- <" + className + "> and <" + apiInfo.implApiClass + "> impl
- u should impl these apis: " + noImplApis + "\n u can check i
- BusExtension's busUtilsClass is empty.
AI-assisted analysis of Blankj/AndroidUtilCode@7b4caf9e54 (2026-08-14).
Data as JSON: /api/errors/f2bfcfb104c446c9.
Report an issue: GitHub.