Configuration Errors
ConfigException: Configuration file not found
ConfigException: Configuration file not found
Error:Cause:
Refractor requires a Or specify a custom path:
refractor.yaml file and fails fast if it’s missing.Source: lib/src/config/config_manager.dart:18-24Solution:Create a configuration file:ConfigException: Configuration YAML is empty
ConfigException: Configuration YAML is empty
Error:Cause:
The config file exists but contains no content.Source:
lib/src/config/config_manager.dart:35-39Solution:Populate the file with at least minimal configuration:ConfigException: Invalid configuration YAML
ConfigException: Invalid configuration YAML
Error:Cause:
YAML syntax error or invalid structure.Source: The verbose flag provides detailed error context.
lib/src/config/model/refractor_config.dart:36-59Solution:Validate YAML syntax:- Check for correct indentation (use spaces, not tabs)
- Ensure colons have spaces after them
- Verify all quoted strings are properly closed
ConfigException: Configuration root must be a YAML mapping
ConfigException: Configuration root must be a YAML mapping
Error:Cause:
The YAML file starts with a list or scalar instead of a map.Source:
lib/src/config/model/refractor_config.dart:48-52Solution:Ensure your config starts with top-level keys:ConfigException: Unknown pass
ConfigException: Unknown pass
Error:Cause:
Referenced a pass name that doesn’t exist.Source: Source:
lib/src/config/model/refractor_config.dart:113Solution:Only use valid pass names:renamestring_encryptdead_code
lib/src/config/model/refractor_config.dart:105-116Build Failures
BuildException: Invalid target
BuildException: Invalid target
Error:Cause:
Specified an unsupported build target.Source: See the Build Targets guide for details.
lib/src/engine/compiler/compiler.dart:26Solution:Use only valid targets:exe- Native executableaot- AOT snapshot (.aot)jit- JIT snapshot (.jit)kernel- Kernel bytecode (.dill)
FileIoException: Input file not found
FileIoException: Input file not found
Error:Cause:
The specified entrypoint doesn’t exist.Exit code: Specify the correct path:
ExitCode.ioError.codeSource: lib/src/exceptions/refractor_exception.dart:64-69Solution:Verify the input file exists:CompilationException: Dart compilation failed
CompilationException: Dart compilation failed
Error:Cause:
Syntax errors, missing dependencies, or other Dart compilation issues.Exit code: Fix any compilation errors, then retry with Refractor:Run with
ExitCode.software.codeSource: lib/src/exceptions/refractor_exception.dart:47-52Solution:First, verify your code compiles normally:--verbose for detailed compiler output:ProcessRunException: Command execution failed
ProcessRunException: Command execution failed
Error:Cause:
Underlying process (dart compile) failed to run.Exit code: Check PATH environment variable includes Dart:Reinstall Dart SDK if necessary.
ExitCode.software.codeSource: lib/src/exceptions/refractor_exception.dart:54-60Solution:Ensure Dart SDK is properly installed:Pass-Specific Issues
Rename pass breaking reflection
Rename pass breaking reflection
Issue:
Code using
dart:mirrors or reflection fails after renaming.Cause:
The rename pass obfuscates identifiers, breaking code that relies on original names at runtime.Solution:String encryption breaking URLs
String encryption breaking URLs
Issue:
Encrypted strings cause runtime issues with URLs or API endpoints.Cause:
String encryption XORs all string literals, including those that must remain readable.Solution:Exclude patterns from encryption:Source:
lib/src/config/model/refractor_config.dart:74-75Dead code affecting control flow
Dead code affecting control flow
Issue:
Dead code injection changes program behavior unexpectedly.Cause:
The dead code pass inserts unreachable branches that should never execute, but edge cases may trigger them.Solution:Reduce insertion frequency:Or disable the pass entirely for testing:Source:
lib/src/config/model/refractor_config.dart:90-92Performance Issues
Slow build times
Slow build times
Issue:
Obfuscation takes significantly longer than normal compilation.Cause:
Multiple passes traverse the entire kernel AST, especially on large codebases.Solution:
Large output file size
Large output file size
Issue:
Obfuscated executable is much larger than expected.Cause:
Dead code injection adds extra bytecode, or you’re using the
exe target.Solution:Use a smaller target format
Runtime performance degradation
Runtime performance degradation
Issue:
Obfuscated app runs slower than the original.Cause:
String encryption adds XOR decoding overhead, and dead code may impact branch prediction.Solution:
Exception Types Reference
Refractor defines specific exception types with appropriate exit codes:| Exception | Exit Code | Common Causes |
|---|---|---|
ConfigException | ExitCode.config.code | Missing/invalid config file, YAML errors |
BuildException | ExitCode.software.code | Invalid target, orchestration errors |
CompilationException | ExitCode.software.code | Dart compilation failures |
ProcessRunException | ExitCode.software.code | Process execution failures |
FileIoException | ExitCode.ioError.code | Missing files, inaccessible directories |
lib/src/exceptions/refractor_exception.dart:7-69
Debugging Tips
Use --verbose flag
Get detailed output for each build step:
Inspect kernel output
Examine obfuscated bytecode:
Build incrementally
Enable passes one at a time to isolate issues:
Compare outputs
Build with and without obfuscation and diff the results:
Getting Help
If you encounter an issue not covered here:- Check the logs - Use
--verboseto get detailed output - Verify your configuration - Ensure
refractor.yamlis valid - Test without obfuscation - Confirm your code compiles normally with
dart compile - Report the issue - Open an issue at github.com/yardexx/refractor
When reporting issues, include:
- Refractor version
- Full error message
refractor.yamlconfiguration- Minimal reproduction steps
Next Steps
Build Targets
Choose the right output format
Debugging
Deobfuscate stack traces with symbol maps