{"record":{"id":"78966cf8c549b53e","repo":"skylot/jadx","slug":"failed-to-apply-options-for-plugin","errorCode":null,"errorMessage":"Failed to apply options for plugin: {}","messagePattern":"Failed to apply options for plugin: (.+?)","errorType":"exception","errorClass":"JadxRuntimeException","httpStatus":null,"severity":"error","filePath":"jadx-core/src/main/java/jadx/core/plugins/PluginContext.java","lineNumber":120,"sourceCode":"\t}\n\n\t@Override\n\tpublic void addCodeInput(JadxCodeInput codeInput) {\n\t\tthis.codeInputs.add(codeInput);\n\t}\n\n\t@Override\n\tpublic List<JadxCodeInput> getCodeInputs() {\n\t\treturn codeInputs;\n\t}\n\n\t@Override\n\tpublic void registerOptions(JadxPluginOptions options) {\n\t\ttry {\n\t\t\tthis.options = Objects.requireNonNull(options);\n\t\t\toptions.setOptions(getArgs().getPluginOptions());\n\t\t} catch (Exception e) {\n\t\t\tthrow new JadxRuntimeException(\"Failed to apply options for plugin: \" + getPluginId(), e);\n\t\t}\n\t}\n\n\t@Override\n\tpublic void registerInputsHashSupplier(Supplier<String> supplier) {\n\t\tthis.inputsHashSupplier = supplier;\n\t}\n\n\t@Override\n\tpublic String getInputsHash() {\n\t\tif (inputsHashSupplier == null) {\n\t\t\treturn defaultOptionsHash();\n\t\t}\n\t\ttry {\n\t\t\treturn inputsHashSupplier.get();\n\t\t} catch (Exception e) {\n\t\t\tthrow new JadxRuntimeException(\"Failed to get inputs hash for plugin: \" + getPluginId(), e);\n\t\t}","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/skylot/jadx/blob/e738a26571d02919f01df40de93bc9a44dee4e18/jadx-core/src/main/java/jadx/core/plugins/PluginContext.java#L102-L138","documentation":"Thrown by PluginContext.registerOptions when calling options.setOptions(...) on a plugin's JadxPluginOptions raises any exception. setOptions receives the raw plugin-options map (getArgs().getPluginOptions()); the most common cause is a plugin option key that the plugin does not expect, or a value that fails the plugin's own parsing inside setOptions.","triggerScenarios":"A user supplies --plugin-option <id>.<key>=<value> (or sets pluginOptions in JadxArgs) whose key does not match any option the plugin declares, or whose value cannot be parsed (e.g. a non-integer for an int option, bad enum value). The plugin's setOptions throws, and PluginContext wraps it naming the plugin id.","commonSituations":"Mistyping a plugin option key on the CLI, passing a value of the wrong type, version mismatch between the option names a plugin accepts and the ones documented, or a plugin whose setOptions has a bug. Loading a plugin built against an older jadx API can also surface here.","solutions":["Check the plugin's documented option names and types; correct the offending --plugin-option.","Inspect the wrapped cause (the JadxRuntimeException chains the original) to see which key/value failed.","Make sure the plugin version matches your jadx version (see VerifyRequiredVersion / errors 192/193).","If you author the plugin, harden setOptions to validate and report each option individually."],"exampleFix":"// before - wrong key / type\nargs.setPluginOptions(Map.of(\"myplugin.retries\", \"fast\"));\n// after\nargs.setPluginOptions(Map.of(\"myplugin.retries\", \"5\"));","handlingStrategy":"validation","validationCode":"// verify option keys/types against the plugin's declared options first\nSet<String> declared = pluginCtx.getOptions()\n        .getOptionsDescriptions().stream()\n        .map(OptionDescription::name)\n        .collect(Collectors.toSet());\nMap<String, String> want = args.getPluginOptions();\nSet<String> unknown = new HashSet<>(want.keySet());\nunknown.removeAll(declared);\nif (!unknown.isEmpty()) throw new IllegalStateException(\"unknown opts: \" + unknown);","typeGuard":null,"tryCatchPattern":"try {\n    pluginCtx.registerOptions(options);\n} catch (JadxRuntimeException e) {\n    LOG.error(\"plugin {} options rejected: {}\", pluginCtx.getPluginId(), e.getCause());\n}","preventionTips":["Spell plugin-option keys exactly as the plugin declares them.","Match option value types to what the plugin's setOptions expects.","Inspect the chained cause to find the offending key/value."],"tags":["plugins","options","configuration","validation","user-input"],"backgroundTag":null,"analyzedSha":"e738a26571d02919f01df40de93bc9a44dee4e18","analyzedAt":"2026-08-14T00:10:24.238Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}