{"record":{"id":"f03659b77d7d3921","repo":"JakeWharton/butterknife","slug":"bindviews-must-specify-at-least-one-id","errorCode":null,"errorMessage":"@BindViews must specify at least one ID. (","messagePattern":"@BindViews must specify at least one ID\\. \\(","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"butterknife-reflect/src/main/java/butterknife/ButterKnife.java","lineNumber":308,"sourceCode":"    } else {\n      throw new IllegalStateException(\"@BindViews must be a List or array. (\"\n          + field.getDeclaringClass().getName()\n          + '.'\n          + field.getName()\n          + ')');\n    }\n    if (!View.class.isAssignableFrom(viewClass) && !viewClass.isInterface()) {\n      throw new IllegalStateException(\n          \"@BindViews List or array type must extend from View or be an interface. (\"\n              + field.getDeclaringClass().getName()\n              + '.'\n              + field.getName()\n              + ')');\n    }\n\n    int[] ids = bindViews.value();\n    if (ids.length == 0) {\n      throw new IllegalStateException(\"@BindViews must specify at least one ID. (\"\n          + field.getDeclaringClass().getName()\n          + '.'\n          + field.getName()\n          + ')');\n    }\n\n    List<Object> views = new ArrayList<>(ids.length);\n    String who = \"field '\" + field.getName() + \"'\";\n    for (int id : ids) {\n      Object view = Utils.findOptionalViewAsType(source, id, who, viewClass);\n      if (view != null) {\n        views.add(view);\n      }\n    }\n\n    Object value;\n    if (isArray) {\n      Object[] viewArray = (Object[]) Array.newInstance(viewClass, views.size());","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/JakeWharton/butterknife/blob/fcdebedf3276096db2f51bf6372b849b5a9c75ed/butterknife-reflect/src/main/java/butterknife/ButterKnife.java#L290-L326","documentation":"parseBindViews requires at least one view ID in the annotation's value array; an empty `@BindViews({})` (or relying on an empty default) produces nothing to bind and throws this IllegalStateException at bind time. The processor flavor reports the equivalent error at compile time.","triggerScenarios":"Writing @BindViews({}) with an empty array literal; generating the annotation from code/templating that yields zero IDs; clearing IDs during debugging.","commonSituations":"Placeholder code committed with empty annotation values; build-time generated binding code with missing ID lists.","solutions":["Supply one or more valid view IDs: @BindViews({R.id.first, R.id.second})","Remove the annotation and field entirely if no views need binding"],"exampleFix":"// before\n@BindViews({})\nList<TextView> labels;\n\n// after\n@BindViews({R.id.first, R.id.second})\nList<TextView> labels;","handlingStrategy":"validation","validationCode":"if (bindViews.value().length == 0) {\n  throw new IllegalStateException(\"@BindViews with no IDs\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass at least one R.id.* to @BindViews","Delete unused annotated fields instead of leaving empty @BindViews({}) placeholders"],"tags":["butterknife","runtime","reflection","validation"],"backgroundTag":null,"analyzedSha":"fcdebedf3276096db2f51bf6372b849b5a9c75ed","analyzedAt":"2026-08-14T10:13:55.083Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}