{"record":{"id":"b5f35b336d1f3250","repo":"HMCL-dev/HMCL","slug":"built-in-theme-pack-asset-is-missing-entryname-b5f35b","errorCode":null,"errorMessage":"Built-in theme-pack asset is missing: ${entryName}","messagePattern":"Built-in theme-pack asset is missing: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackResource.java","lineNumber":161,"sourceCode":"        /// @param resourcePath the classpath resource path\n        /// @param entryName    the theme-pack entry name\n        public Builtin {\n            resourcePath = Objects.requireNonNull(resourcePath);\n            entryName = ThemePackAsset.normalizeEntryName(entryName);\n        }\n\n        /// Returns the theme-pack entry name.\n        @Override\n        public String name() {\n            return entryName;\n        }\n\n        /// Opens the classpath resource.\n        @Override\n        public InputStream openStream() throws IOException {\n            @Nullable InputStream input = ThemePackResource.class.getResourceAsStream(resourcePath);\n            if (input == null) {\n                throw new IOException(\"Built-in theme-pack asset is missing: \" + entryName);\n            }\n            return input;\n        }\n    }\n\n    /// An input stream that owns a zip file handle.\n    @NotNullByDefault\n    final class ZipEntryInputStream extends FilterInputStream {\n        /// The zip file that must stay open while this stream is read.\n        private final ZipArchiveReader zipFile;\n\n        /// Whether this stream has already been closed.\n        private boolean closed;\n\n        /// Creates a zip-entry stream.\n        ///\n        /// @param input   the zip entry input stream\n        /// @param zipFile the owning zip file","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/theme/ThemePackResource.java#L143-L179","documentation":"BuiltInThemePackResource.openStream reads a classpath resource via getResourceAsStream(resourcePath); a null result means the built-in pack's asset is absent from the classpath/Jar, so it throws IOException \"Built-in theme-pack asset is missing: <entryName>\". This indicates a broken or stripped installation rather than user data.","triggerScenarios":"The HMCL jar was built/packaged without the built-in theme resource files; resourcePath differs from the packaged location; running from a partially extracted distribution.","commonSituations":"Custom or minimal builds excluding resource directories; shading/assembly plugins dropping non-class resources; antivirus or deployment tooling stripping files from the jar.","solutions":["Re-download or rebuild HMCL with resources included (check the jar contains the built-in theme asset paths).","Verify resourcePath matches the actual classpath location of the asset.","Check build/packaging configuration so resource files are not excluded from the jar."],"exampleFix":"// build.gradle exclusion dropping resources\nexclude '**/*.png'\n// after\n// remove the exclude so theme assets ship in the jar","handlingStrategy":"fallback","validationCode":"boolean available = ThemePackResource.class.getResource(resourcePath) != null;","typeGuard":null,"tryCatchPattern":"try (InputStream in = resource.openStream()) { use(in); } catch (IOException e) { loadFallbackTheme(); }","preventionTips":["Verify the distribution jar includes all resource directories","Avoid build excludes on non-class resources","Smoke-test built-in themes after repackaging"],"tags":["theme-pack","classpath","resource-not-found"],"backgroundTag":"resource-not-found","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}