{"record":{"id":"ebbda09460836478","repo":"pxb1988/dex2jar","slug":"can-t-find-method","errorCode":null,"errorMessage":"can't find method ","messagePattern":"can't find method ","errorType":"exception","errorClass":"NoSuchMethodException","httpStatus":null,"severity":"error","filePath":"dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java","lineNumber":835,"sourceCode":"        for (MethodConfig config : methodConfigs) {\n            Method jmethod;\n            try {\n                Class<?> clz = cl.loadClass(config.owner.replace('/', '.'));\n                if (clz == null) {\n                    System.err.println(\"clz is null:\" + config.owner);\n                }\n                jmethod = findAnyMethodMatch(clz, config.name,\n                        toJavaType(Type.getArgumentTypes(config.desc)));\n            } catch (Exception ex) {\n                System.err.println(\"can't load method: L\" + config.owner + \";->\" + config.name + config.desc);\n                throw ex;\n            }\n            if (jmethod != null) {\n                jmethod.setAccessible(true);\n                config.jmethod = jmethod;\n                map.put(config, config);\n            } else {\n                throw new NoSuchMethodException(\"can't find method \" + config.name + config.desc + \" on class \" + config.owner + \" or its parent\");\n            }\n        }\n        return map;\n    }\n\n    /**\n     * collect methods from --methods and --method-owner,--method-name\n     *\n     * @return\n     * @throws IOException\n     */\n    private List<MethodConfig> collectMethodConfigs() throws IOException {\n        List<MethodConfig> methodConfigs = new ArrayList<>();\n        if (this.method != null) {\n            for (String line : Files.readAllLines(this.method, StandardCharsets.UTF_8)) {\n                if (line.length() == 0 || line.startsWith(\"#\")) {\n                    continue;\n                }","sourceCodeStart":817,"sourceCodeEnd":853,"githubUrl":"https://github.com/pxb1988/dex2jar/blob/b5bda4fb4935ae8b3869b422454ae3b3896c7bc1/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java#L817-L853","documentation":"During setup DecryptStringCmd resolves each configured method (owner/name/desc) on the loaded classes to a reflective java.lang.reflect.Method, walking up the class hierarchy. If no matching method exists it throws NoSuchMethodException naming the missing member.","triggerScenarios":"A config entry's owner class doesn't contain (nor inherit) a method with exactly the configured name and descriptor — e.g. the class is missing from the jar, obfuscated/renamed, or the descriptor typo'd.","commonSituations":"Pointing the tool at an obfuscated APK jar where method names were renamed, or targeting a method from a library dependency not present in the scanned classpath.","solutions":["Verify the method name and descriptor in the config match the actual jar (use javap -p)","Confirm the owner class exists in the input jar and isn't obfuscated/renamed","Include dependency jars so parent classes can be loaded when the method is inherited","Fix the config line's name/desc to the real signature"],"exampleFix":"// before (config)\nLcom/foo/Bar;->decrypt(Ljava/lang/String;)Ljava/lang/String;\n// after (matching real signature via javap)\nLcom/foo/Bar;->a(Ljava/lang/String;)Ljava/lang/String;","handlingStrategy":"try-catch","validationCode":"// Pre-check via reflection before configuring\nClass<?> c = Class.forName(owner.replace('/', '.'), false, loader);\nboolean found = java.util.Arrays.stream(c.getMethods()).anyMatch(m -> m.getName().equals(name) && Type.getMethodDescriptor(m).equals(desc));","typeGuard":null,"tryCatchPattern":"try { setupConfigs(configs); } catch (NoSuchMethodException e) { log.error(\"Config points to missing method: \" + e.getMessage()); configErrorExit(); }","preventionTips":["Cross-check config entries against `javap -p` output of the actual jar","Re-derive configs after obfuscation/renaming changes","Include dependency jars on the tool's classpath for inherited methods"],"tags":["reflection","method-not-found","config"],"backgroundTag":"method-not-found","analyzedSha":"b5bda4fb4935ae8b3869b422454ae3b3896c7bc1","analyzedAt":"2026-09-08T00:44:01.258Z","contentChangedAt":"2026-09-08T00:44:01.258Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}