Blankj/AndroidUtilCode · error · Exception

No ApiUtils of ${apiUtilsClass} in $mProject.

Error message

No ApiUtils of ${apiUtilsClass} in $mProject.

What it means

ApiPlugin sets apiUtilsTransformFile only in scanClassFile(), when it encounters a class whose name equals apiUtilsClass. In onScanFinished(), if apiUtilsTransformFile is still null (the class was never seen), it throws Exception. There is nothing to inject the impl registry into, so the build cannot proceed.

Source

Thrown at plugin/api-gradle-plugin/src/main/java/com/blankj/api/ApiPlugin.groovy:112

                }
                Map apiDetails = [:]
                apiDetails.put("ApiUtilsClass", apiUtilsClass)
                apiDetails.put("implApis", implApis)
                apiDetails.put("noImplApis", noImplApis)
                String apiJson = JsonUtils.getFormatJson(apiDetails)
                log(jsonFile.toString() + ": " + apiJson)
                FileUtils.write(jsonFile, apiJson)

                if (noImplApis.size() > 0) {
                    if (ext.abortOnError) {
                        throw new Exception("u should impl these apis: " + noImplApis +
                                "\n u can check it in file: " + jsonFile.toString())
                    }
                }
                ApiInject.start(apiImplMap, apiUtilsTransformFile, apiUtilsClass)
            }
        } else {
            throw new Exception("No ApiUtils of ${apiUtilsClass} in $mProject.")
        }
    }
}

View on GitHub (pinned to 7b4caf9e54)

Solutions

  1. Ensure the dependency providing apiUtilsClass is on the app classpath, e.g. api 'com.blankj:utilcode:latest.release'.
  2. Verify apiUtilsClass exactly matches the FQN of the ApiUtils class present (correct package, no typo).
  3. If using onlyScanLibRegex/jumpScanLibRegex, make sure the jar/module containing ApiUtils is not excluded (utilcode is never skipped by isIgnoreScan).

Example fix

// before - apiUtilsClass points at a class not on the classpath
api { apiUtilsClass "com.example.MyApiUtils" }   // missing -> "No ApiUtils of ..."

// after - provide the dependency, or use the default
dependencies { api 'com.blankj:utilcode:latest.release' }
api { apiUtilsClass "com.blankj.utilcode.util.ApiUtils" }   // or omit the block
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: apiUtilsClass names a class not present on the app's compiled classpath; the ApiUtils 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 apiUtilsClass "com.xxx.xxx.ApiUtils" for a custom copy but the dependency providing it is missing; forgot to add api "com.blankj:utilcode:..."; the ApiUtils jar is filtered out by a scan regex.

Related errors


AI-assisted analysis of Blankj/AndroidUtilCode@7b4caf9e54 (2026-08-14). Data as JSON: /api/errors/f412a1c44a67f0fc. Report an issue: GitHub.