I’m working on a new Android project using Jetpack Compose and trying to integrate design tokens from Figma through the Relay plugin. I followed a tutorial that shows how to import Figma styles into a Compose project.
The process involves importing a design_tokens.json file that contains all the styling information from Figma. I successfully generated this JSON file from my Figma design, but when I try to import it into Android Studio, I’m running into problems.
The main issue is that Android Studio fails to recognize and import the necessary packages after adding the JSON file to my project. The IDE shows import errors and I can’t proceed with setting up the theme system.
Has anyone encountered similar problems when working with Figma design tokens and the Relay plugin? What could be causing these import issues and how can I resolve them to properly set up my Compose theme?
Had this same issue last month migrating our design system. Import failures usually mean your Relay plugin config is wrong, not a dependency problem. Check that Relay’s enabled in Android Studio settings and you’re using the right Gradle wrapper version. What worked for me: create a separate module just for design tokens, import the JSON there first, then integrate with your main app. Relay conflicts with existing themes sometimes, so isolating it makes debugging way easier. Also heads up - some Figma token structures don’t work yet, especially custom shadows and complex gradients.
Been there with Figma tokens - plugin dependencies and version mismatches are a total nightmare. I ditched manual imports and automated the whole workflow instead.
Set up automation that watches my Figma file and converts tokens to the exact format my Compose project needs. No more fighting Relay plugin versions or random import errors.
It pulls tokens straight from Figma’s API, transforms them into Kotlin objects for Compose themes, and pushes updates directly to my repo. Takes 10 minutes to set up, saves hours debugging plugin issues.
Skip the manual JSON handling and plugin headaches. Automate the pipeline from Figma to your codebase. Way more reliable than plugins that break with every Android Studio update.
Check out Latenode - handles Figma API integration and file transformations without coding: https://latenode.com
Check if your design_tokens.json structure matches what Relay wants. I hit the same import issues when my JSON had nested color values that Android’s color system couldn’t handle. The plugin’s super picky about hex values and naming conventions. Also verify your manifest file - make sure it’s got the right application theme reference pointing to your generated theme. Sometimes the import works fine but the connection between your JSON tokens and theme implementation breaks during build. Still getting package import errors? Try invalidating caches and restart Android Studio completely. Relay plugin doesn’t refresh properly after adding new token files, especially if you changed the JSON structure post-import.
I encountered the same issue while integrating Figma design tokens with Jetpack Compose using the Relay plugin. The import errors often stem from a version mismatch between the Relay plugin and your project’s configuration. To resolve this, I recommend reviewing your build.gradle files to ensure that the Compose BOM version aligns with the expectations set by the Figma tokens. Additionally, make sure you have included all necessary Relay runtime dependencies in your module-level build.gradle, as these may not be automatically added. A clean build can also help, along with verifying that your compileSdk version is updated to support the material design components generated by the plugin.
had the same issue b4! cleaning the project fixed it for me. also, make sure your design_tokens.json is in the right dir. it was in a wrong one for me too and that caused the import mess.
Had the same problem with design tokens and Relay. This usually happens when the Relay plugin is missing some dependencies in your build.gradle file. Make sure you’ve got the latest Relay library version in your module dependencies. Also check that your design_tokens.json file is in the assets folder like the tutorial shows. Try clearing cache and rebuilding—sometimes Android Studio just needs a kick to recognize the changes. If you’re still stuck, I’d create a small test project first to figure out what’s wrong with your setup before messing with your main project.