{"record":{"id":"7bf76c703ce8c7ee","repo":"airbnb/epoxy","slug":"unable-to-get-epoxy-helper-class","errorCode":null,"errorMessage":"Unable to get Epoxy helper class.","messagePattern":"Unable to get Epoxy helper class\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"epoxy-adapter/src/main/java/com/airbnb/epoxy/ControllerHelperLookup.java","lineNumber":40,"sourceCode":"    if (constructor == null) {\n      return NO_OP_CONTROLLER_HELPER;\n    }\n\n    try {\n      return (ControllerHelper) constructor.newInstance(controller);\n    } catch (IllegalAccessException e) {\n      throw new RuntimeException(\"Unable to invoke \" + constructor, e);\n    } catch (InstantiationException e) {\n      throw new RuntimeException(\"Unable to invoke \" + constructor, e);\n    } catch (InvocationTargetException e) {\n      Throwable cause = e.getCause();\n      if (cause instanceof RuntimeException) {\n        throw (RuntimeException) cause;\n      }\n      if (cause instanceof Error) {\n        throw (Error) cause;\n      }\n      throw new RuntimeException(\"Unable to get Epoxy helper class.\", cause);\n    }\n  }\n\n  @Nullable\n  private static Constructor<?> findConstructorForClass(Class<?> controllerClass) {\n    Constructor<?> helperCtor = BINDINGS.get(controllerClass);\n    if (helperCtor != null || BINDINGS.containsKey(controllerClass)) {\n      return helperCtor;\n    }\n\n    String clsName = controllerClass.getName();\n    if (clsName.startsWith(\"android.\") || clsName.startsWith(\"java.\")) {\n      return null;\n    }\n\n    try {\n      Class<?> bindingClass = Class.forName(clsName + GENERATED_HELPER_CLASS_SUFFIX);\n      //noinspection unchecked","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/airbnb/epoxy/blob/e45bd3a61fe3a1f130e184f5b8dcf172ab99025a/epoxy-adapter/src/main/java/com/airbnb/epoxy/ControllerHelperLookup.java#L22-L58","documentation":"When the reflective helper creation fails with InvocationTargetException whose cause is neither RuntimeException nor Error, the library wraps the cause in RuntimeException('Unable to get Epoxy helper class.'). This means the generated helper's constructor ran and threw a checked/other throwable.","triggerScenarios":"The generated _EpoxyHelper constructor for a controller throws a checked exception (e.g. Exception from an initializer block or field initialization in the controller/helper) that is not a RuntimeException or Error.","commonSituations":"Controller field initializers or constructor-time code throwing checked exceptions; classpath conflicts causing NoClassDefFoundError-like checked paths; mismatched epoxy-compiler and epoxy-adapter versions producing broken generated code.","solutions":["Read the cause chain (RuntimeException.getCause()) to find the original throwable thrown inside the helper constructor.","Fix the throwing initializer in the controller so construction cannot fail.","Align epoxy-compiler, epoxy-adapter, and epoxy-processor versions.","Clean/rebuild to regenerate helpers after moving or renaming controllers."],"exampleFix":"// before\nclass MyController extends EpoxyController {\n  private final Config cfg = loadConfigChecked(); // throws checked exception\n}\n\n// after\nclass MyController extends EpoxyController {\n  private final Config cfg;\n  MyController() { this.cfg = loadConfigSafely(); } // no throwing initializer\n}","handlingStrategy":"try-catch","validationCode":"// audit controller field initializers for code that can throw during construction","typeGuard":null,"tryCatchPattern":"try { helper = ControllerHelperLookup.getHelperForController(controller); } catch (RuntimeException e) { Throwable cause = e.getCause(); log(\"Helper ctor threw\", cause); }","preventionTips":["Keep controller constructors and field initializers exception-free.","Align all epoxy artifact versions.","Clean rebuild after moving/renaming controllers."],"tags":["android","epoxy","reflection","invocation-target","code-generation"],"backgroundTag":"module-init-failed","analyzedSha":"e45bd3a61fe3a1f130e184f5b8dcf172ab99025a","analyzedAt":"2026-09-13T03:24:16.052Z","contentChangedAt":"2026-09-13T03:24:16.052Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}