{"record":{"id":"b1b6749d0ed1ffe7","repo":"Konloch/bytecode-viewer","slug":"unknown-implementation","errorCode":null,"errorMessage":"Unknown implementation","messagePattern":"Unknown implementation","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"src/main/java/the/bytecode/club/bytecodeviewer/util/apk2Jar/Apk2Jar.java","lineNumber":94,"sourceCode":"        synchronized (workLock) {\n            apk2JarImpl(input, output);\n        }\n        return output;\n    }\n\n    protected abstract void apk2JarImpl(File input, File output);\n    protected abstract void apk2FolderImpl(File input, File output);\n\n    public static Apk2Jar obtainImpl() {\n        MainViewerGUI viewer = BytecodeViewer.viewer;\n        ButtonGroup apkConversionGroup = viewer.apkConversionGroup;\n\n        if (apkConversionGroup.isSelected(viewer.apkConversionDex.getModel()))\n            return new Dex2Jar();\n        else if (apkConversionGroup.isSelected(viewer.apkConversionEnjarify.getModel()))\n            return new Enjarify();\n\n        throw new RuntimeException(\"Unknown implementation\");\n    }\n}\n","sourceCodeStart":76,"sourceCodeEnd":97,"githubUrl":"https://github.com/Konloch/bytecode-viewer/blob/31430e0033fa220db566b5ef461256727ff6793b/src/main/java/the/bytecode/club/bytecodeviewer/util/apk2Jar/Apk2Jar.java#L76-L97","documentation":"This RuntimeException is thrown by Bytecode Viewer's Apk2Jar utility when the APK-to-JAR conversion routine cannot determine which converter implementation to use. The method checks the GUI radio buttons 'apkConversionDex' and 'apkConversionEnjarify' in the settings/viewer panel; if neither model is selected, no known converter matches and it fails. It effectively signals an inconsistent or uninitialized UI selection state rather than a conversion failure.","triggerScenarios":"Calling Apk2Jar.obtainImpl() (e.g. via the APK conversion flow) while neither the DEX nor Enjarify radio button (viewer.apkConversionDex / viewer.apkConversionEnjarify) is selected in the apkConversionGroup ButtonGroup; or programmatically constructing/clearing the ButtonGroup so no toggle is active before conversion starts.","commonSituations":"Headless/CLI usage or automation where the GUI settings panel was never initialized or defaults were removed; custom themes/plugins that reset ButtonGroup selection; saving/loading a config that clears the radio selection; code changes that renamed or replaced one of the toggle buttons so isSelected() checks miss.","solutions":["Ensure a default conversion option is selected at startup, e.g. viewer.apkConversionDex.setSelected(true) inside the ButtonGroup before any conversion runs","Inspect the viewer panel state at the time of the error and confirm apkConversionDex or apkConversionEnjarify is actually in apkConversionGroup and selected","If driving Bytecode Viewer programmatically, explicitly select one conversion mode before invoking the Apk2Jar flow","Reinstall/restore a clean Bytecode Viewer configuration (delete overridden settings like the saved config XML) if a stale config left no radio selected","Update Bytecode Viewer to the latest version if a regression in the settings panel left the group uninitialized"],"exampleFix":"// before\nApk2Jar.convert(...); // assumes a radio button is already selected\n\n// after\nif (!viewer.apkConversionDex.isSelected() && !viewer.apkConversionEnjarify.isSelected()) {\n    viewer.apkConversionDex.setSelected(true); // enforce a default\n}\nApk2Jar.convert(...);","handlingStrategy":"validation","validationCode":"if (!viewer.apkConversionDex.isSelected() && !viewer.apkConversionEnjarify.isSelected()) {\n    viewer.apkConversionDex.setSelected(true);\n}\n// now safe to run the APK-to-JAR conversion","typeGuard":null,"tryCatchPattern":"try {\n    Apk2Jar.convert(apkFile);\n} catch (RuntimeException e) {\n    if (\"Unknown implementation\".equals(e.getMessage())) {\n        viewer.apkConversionDex.setSelected(true); // restore a default\n        Apk2Jar.convert(apkFile); // retry once with the default converter\n    } else {\n        throw e;\n    }\n}","preventionTips":["Always set a default selection on the apkConversionGroup radio buttons when initializing the viewer UI","Validate that exactly one conversion option is selected before invoking conversion","Avoid programmatically clearing ButtonGroup selections in themes or config loaders","When automating Bytecode Viewer headlessly, set the conversion toggle explicitly in code rather than relying on saved UI state"],"tags":["java","runtime-exception","gui-state","apk-conversion","bytecode-viewer"],"backgroundTag":"unselected-required-option","analyzedSha":"31430e0033fa220db566b5ef461256727ff6793b","analyzedAt":"2026-09-05T18:22:22.725Z","contentChangedAt":"2026-09-05T18:22:22.725Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}