Troubleshooting
Common issues and solutions when using Figma Flutter Generator
Troubleshooting Guide
This guide covers common issues you might encounter when using Figma Flutter Generator and their solutions.
Command Not Found
zsh: command not found: figma_flutter_generator
Solutions:
-
Verify installation:
dart pub global list | grep figma_flutter_generator
-
Add pub cache to PATH:
# For bash echo 'export PATH="$PATH":"$HOME/.pub-cache/bin"' >> ~/.bashrc source ~/.bashrc # For zsh echo 'export PATH="$PATH":"$HOME/.pub-cache/bin"' >> ~/.zshrc source ~/.zshrc
pdf2svg Not Found
Error: pdf2svg command not found
Solutions:
-
Install via package manager:
# macOS brew install pdf2svg # Linux sudo apt-get install pdf2svg # Windows # Download from: http://www.cityinthesky.co.uk/opensource/pdf2svg/
-
Verify installation:
pdf2svg --version
Icons Not Found in Figma
Error: No icon components found in the specified node
Solutions:
-
Verify node ID:
- Check if the node ID is correct
- Ensure the node contains icon components
- Try copying the node ID again from Figma
-
Check component setup:
- Ensure icons are created as components
- Verify frame is selected, not individual icons
- Check if icons are properly named
SVG Conversion Errors
Error converting PDF to SVG: Invalid file format
Solutions:
-
Try PDF download method:
# Remove --direct-svg flag figma_flutter_generator icons \ --token YOUR_TOKEN \ --file FILE_ID \ --node NODE_ID \ --output ./lib/icons
-
Check icon complexity:
- Simplify complex paths
- Remove unsupported effects
- Convert strokes to fills
Font Generation Failed
Error: Failed to generate icon font
Solutions:
-
Check SVG files:
- Verify SVGs are valid
- Ensure consistent sizing
- Remove any empty SVG files
-
Clean and retry:
figma_flutter_generator icons \ --token YOUR_TOKEN \ --file FILE_ID \ --node NODE_ID \ --output ./lib/icons \ --clean
API Access Errors
Error: Variables API access denied
Solutions:
-
Check Figma plan:
- Verify Enterprise plan subscription
- Contact Figma support if needed
-
Verify token permissions:
- Generate new token
- Ensure correct file access
Variable Collection Not Found
Error: Mapped collection not found
Solutions:
-
Check collection name:
- Ensure collection is named exactly "1. ✨Mapped"
- Check for hidden spaces or characters
-
Verify collection setup:
- Check if collection exists
- Ensure variables are added
- Verify mode configuration
Type Conversion Errors
Error: Invalid variable type or value
Solutions:
-
Check variable types:
- Use supported types (COLOR, FLOAT, STRING)
- Verify value formats
- Check for null values
-
Review variable values:
- Ensure all modes have values
- Check value format consistency
- Validate color definitions
Icons Not Displaying
Solutions:
-
Check font registration:
# pubspec.yaml flutter: fonts: - family: IconFont fonts: - asset: lib/icons/icons.ttf
-
Verify imports:
import 'package:your_project/icons/icons.dart';
Theme Not Applying
Solutions:
-
Check theme implementation:
MaterialApp( theme: AppTheme.getLightTheme(), darkTheme: AppTheme.getDarkTheme(), )
-
Verify theme imports:
import 'package:your_project/theme/light_theme.dart'; import 'package:your_project/theme/dark_theme.dart';
Authentication Errors
Error: Invalid access token
Solutions:
- Regenerate token in Figma
- Check token permissions
- Verify token is properly copied
File Access Errors
Error: File not found or access denied
Solutions:
- Verify file ID
- Check file permissions
- Ensure file is not deleted
Network Errors
Error: Failed to connect to Figma API
Solutions:
- Check internet connection
- Verify API endpoint access
- Try again later
Getting Help
If you're still experiencing issues:
-
Enable verbose logging:
figma_flutter_generator icons \ --token YOUR_TOKEN \ --file FILE_ID \ --node NODE_ID \ --output ./lib/icons \ --verbose
-
Check GitHub issues:
- Search existing issues
- Create new issue with logs
- Provide reproduction steps
-
Contact support:
- Include error messages
- Attach log output
- Describe your setup