{"record":{"id":"f412a1c44a67f0fc","repo":"Blankj/AndroidUtilCode","slug":"no-apiutils-of-apiutilsclass-in-mproject","errorCode":null,"errorMessage":"No ApiUtils of ${apiUtilsClass} in $mProject.","messagePattern":"No ApiUtils of (.+?) in \\$mProject\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"plugin/api-gradle-plugin/src/main/java/com/blankj/api/ApiPlugin.groovy","lineNumber":112,"sourceCode":"                }\n                Map apiDetails = [:]\n                apiDetails.put(\"ApiUtilsClass\", apiUtilsClass)\n                apiDetails.put(\"implApis\", implApis)\n                apiDetails.put(\"noImplApis\", noImplApis)\n                String apiJson = JsonUtils.getFormatJson(apiDetails)\n                log(jsonFile.toString() + \": \" + apiJson)\n                FileUtils.write(jsonFile, apiJson)\n\n                if (noImplApis.size() > 0) {\n                    if (ext.abortOnError) {\n                        throw new Exception(\"u should impl these apis: \" + noImplApis +\n                                \"\\n u can check it in file: \" + jsonFile.toString())\n                    }\n                }\n                ApiInject.start(apiImplMap, apiUtilsTransformFile, apiUtilsClass)\n            }\n        } else {\n            throw new Exception(\"No ApiUtils of ${apiUtilsClass} in $mProject.\")\n        }\n    }\n}","sourceCodeStart":94,"sourceCodeEnd":115,"githubUrl":"https://github.com/Blankj/AndroidUtilCode/blob/7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809/plugin/api-gradle-plugin/src/main/java/com/blankj/api/ApiPlugin.groovy#L94-L115","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Ensure the dependency providing apiUtilsClass is on the app classpath, e.g. api 'com.blankj:utilcode:latest.release'.","Verify apiUtilsClass exactly matches the FQN of the ApiUtils class present (correct package, no typo).","If using onlyScanLibRegex/jumpScanLibRegex, make sure the jar/module containing ApiUtils is not excluded (utilcode is never skipped by isIgnoreScan)."],"exampleFix":"// before - apiUtilsClass points at a class not on the classpath\napi { apiUtilsClass \"com.example.MyApiUtils\" }   // missing -> \"No ApiUtils of ...\"\n\n// after - provide the dependency, or use the default\ndependencies { api 'com.blankj:utilcode:latest.release' }\napi { apiUtilsClass \"com.blankj.utilcode.util.ApiUtils\" }   // or omit the block","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include the dependency that hosts the configured ApiUtils class (utilcode by default).","Double-check the apiUtilsClass FQN against the actual class package/name.","Avoid scan-regex rules that would exclude the jar containing ApiUtils."],"tags":["gradle-plugin","api","build","dependency","asm"],"backgroundTag":null,"analyzedSha":"7b4caf9e5440046b3fefb63b6b6e2ead7ebaf809","analyzedAt":"2026-08-14T02:26:54.956Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}