{"record":{"id":"b83d77403b4dd6b8","repo":"Tencent/matrix","slug":"something-wrong-with-trace-see-detail-log-before","errorCode":null,"errorMessage":"something wrong with trace, see detail log before","messagePattern":"something wrong with trace, see detail log before","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"matrix/matrix-android/matrix-gradle-plugin/src/main/java/com/tencent/matrix/trace/MethodTracer.java","lineNumber":91,"sourceCode":"    private volatile boolean traceError = false;\n\n    public MethodTracer(ExecutorService executor, MappingCollector mappingCollector, Configuration config, ConcurrentHashMap<String, TraceMethod> collectedMap, ConcurrentHashMap<String, String> collectedClassExtendMap) {\n        this.configuration = config;\n        this.mappingCollector = mappingCollector;\n        this.executor = executor;\n        this.collectedClassExtendMap = collectedClassExtendMap;\n        this.collectedMethodMap = collectedMap;\n    }\n\n    public void trace(Map<File, File> srcFolderList, Map<File, File> dependencyJarList, ClassLoader classLoader, boolean ignoreCheckClass) throws ExecutionException, InterruptedException {\n        List<Future> futures = new LinkedList<>();\n        traceMethodFromSrc(srcFolderList, futures, classLoader, ignoreCheckClass);\n        traceMethodFromJar(dependencyJarList, futures, classLoader, ignoreCheckClass);\n        for (Future future : futures) {\n            future.get();\n        }\n        if (traceError) {\n            throw new IllegalArgumentException(\"something wrong with trace, see detail log before\");\n        }\n        futures.clear();\n    }\n\n    private void traceMethodFromSrc(Map<File, File> srcMap, List<Future> futures, final ClassLoader classLoader, final boolean skipCheckClass) {\n        if (null != srcMap) {\n            for (Map.Entry<File, File> entry : srcMap.entrySet()) {\n                futures.add(executor.submit(new Runnable() {\n                    @Override\n                    public void run() {\n                        innerTraceMethodFromSrc(entry.getKey(), entry.getValue(), classLoader, skipCheckClass);\n                    }\n                }));\n            }\n        }\n    }\n\n    private void traceMethodFromJar(Map<File, File> dependencyMap, List<Future> futures, final ClassLoader classLoader, final boolean skipCheckClass) {","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/Tencent/matrix/blob/3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7/matrix/matrix-android/matrix-gradle-plugin/src/main/java/com/tencent/matrix/trace/MethodTracer.java#L73-L109","documentation":"Thrown by MethodTracer.trace after tracing all class/jar inputs concurrently: if any trace worker set the traceError flag, the collected futures are awaited and then an IllegalArgumentException('something wrong with trace, see detail log before') is thrown. It aggregates a failure that occurred while instrumenting method bodies with Matrix's method-canary/trace bytecode transforms. The per-file stack trace was already logged before this aggregate exception.","triggerScenarios":"Any single .class or .jar entry fails bytecode transformation during traceMethodFromSrc/traceMethodFromJar — e.g. unexpected bytecode patterns, ASM visitor exceptions on obfuscated classes, or IO errors reading class files.","commonSituations":"Applying the Matrix trace plugin to modules with unusual bytecode (Kotlin coroutines, certain obfuscation by R8/ProGuard) or corrupted jar dependencies; version mismatch between AGP and the Matrix plugin's ASM version.","solutions":["Scroll up in the build log to find the per-class stack trace logged before this aggregate error — it names the failing class/jar","Exclude the problematic class/package from tracing via the plugin's ignore/whiteList configuration","Upgrade Matrix to the latest version to get fixes for known bytecode-handling issues","Check compatibility between the Matrix plugin, AGP, and Gradle versions; downgrade/upgrade accordingly"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    methodTracer.trace(srcMap, jarList, classLoader, false)\n} catch (IllegalArgumentException e) {\n    logger.error('Matrix trace failed: inspect the per-class stack trace logged above for the failing class', e)\n    throw e\n}","preventionTips":["Always read the earlier build-log stack traces; this exception is only an aggregate marker","Keep Matrix plugin, AGP and Gradle versions compatible","Configure ignore/whiteList rules for classes known to break ASM instrumentation"],"tags":["gradle-plugin","bytecode-instrumentation","asm","method-tracer"],"backgroundTag":"internal-invariant-violation","analyzedSha":"3b8293bd65d47eeea7caf1f32a3a5d4d5eab60e7","analyzedAt":"2026-09-08T08:01:39.722Z","contentChangedAt":"2026-09-08T08:01:39.722Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}