Konloch/bytecode-viewer · error · RuntimeException
Unknown implementation
Error message
Unknown implementation
What it means
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.
Source
Thrown at src/main/java/the/bytecode/club/bytecodeviewer/util/apk2Jar/Apk2Jar.java:94
synchronized (workLock) {
apk2JarImpl(input, output);
}
return output;
}
protected abstract void apk2JarImpl(File input, File output);
protected abstract void apk2FolderImpl(File input, File output);
public static Apk2Jar obtainImpl() {
MainViewerGUI viewer = BytecodeViewer.viewer;
ButtonGroup apkConversionGroup = viewer.apkConversionGroup;
if (apkConversionGroup.isSelected(viewer.apkConversionDex.getModel()))
return new Dex2Jar();
else if (apkConversionGroup.isSelected(viewer.apkConversionEnjarify.getModel()))
return new Enjarify();
throw new RuntimeException("Unknown implementation");
}
}
View on GitHub (pinned to 31430e0033)
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
Example fix
// before
Apk2Jar.convert(...); // assumes a radio button is already selected
// after
if (!viewer.apkConversionDex.isSelected() && !viewer.apkConversionEnjarify.isSelected()) {
viewer.apkConversionDex.setSelected(true); // enforce a default
}
Apk2Jar.convert(...); Defensive patterns
Strategy: validation
Validate before calling
if (!viewer.apkConversionDex.isSelected() && !viewer.apkConversionEnjarify.isSelected()) {
viewer.apkConversionDex.setSelected(true);
}
// now safe to run the APK-to-JAR conversion Try / catch
try {
Apk2Jar.convert(apkFile);
} catch (RuntimeException e) {
if ("Unknown implementation".equals(e.getMessage())) {
viewer.apkConversionDex.setSelected(true); // restore a default
Apk2Jar.convert(apkFile); // retry once with the default converter
} else {
throw e;
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unknown constant pool tag ${tag}
- null key or factory
- factory already registered with key: ${key}
- null key
- factory doesn't key for key: ${key}
AI-assisted analysis of Konloch/bytecode-viewer@31430e0033 (2026-09-05).
Data as JSON: /api/errors/b1b6749d0ed1ffe7.
Report an issue: GitHub.