{"record":{"id":"bf24a2ac5e53947b","repo":"slint-ui/slint","slug":"dex-conversion-failed","errorCode":null,"errorMessage":"Dex conversion failed","messagePattern":"Dex conversion failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/backends/android-activity/build.rs","lineNumber":82,"sourceCode":"        .android_min_api(20) // disable multidex for single dex file output\n        .out_dir(out_dir)\n        .command()\n        .unwrap_or_else(|e| panic!(\"Could not generate the D8 command: {e}\"))\n        .output()\n        .unwrap_or_else(|e| panic!(\"Error running D8: {e}\"));\n\n    if !o.status.success() {\n        eprintln!(\"Dex conversion failed: {}\", String::from_utf8_lossy(&o.stderr));\n        let java_home = android_build::java_home().unwrap();\n        let java_ver = android_build::check_javac_version(&java_home).unwrap();\n        if java_ver >= 21 {\n            eprintln!(\"WARNING: JDK version 21 is known to cause an error with older android SDK\");\n            eprintln!(\"See https://github.com/slint-ui/slint/issues/4973\");\n            eprintln!(\n                \"Try downgrading your version of Java to something like JDK 17, or upgrade to the SDK build tools 35\"\n            );\n        }\n        panic!(\"Dex conversion failed\");\n    }\n\n    println!(\"cargo:rerun-if-changed={java_src_path}\");\n}\n","sourceCodeStart":64,"sourceCodeEnd":87,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/internal/backends/android-activity/build.rs#L64-L87","documentation":"D8 ran but exited with a non-zero status during the .class -> .dex conversion; the build script prints D8's stderr under this message rather than panicking immediately. It means the Java class files produced by the earlier javac step could not be dexed — commonly bytecode level vs. D8 version mismatch, or (as the following JDK>=21 warning shows) a too-new JDK producing classes this D8 cannot process.","triggerScenarios":"Thrown at internal/backends/android-activity/build.rs:82 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the D8 stderr printed with the panic for the real cause: most often multidex/MethodTooLarge issues or invalid class files","Follow the built-in hint: the script checks the JDK version and warns when JDK >= 21 is used; downgrade to JDK 17 or a compatible toolchain if that warning appears","Confirm android_min_api (20) and the single-dex assumption still hold; if the dex exceeds limits, raise min API or enable multidex","Ensure all dependency jars (android.jar, d8 jar) match the build-tools version in use"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}