I’m facing an issue while trying to import UI elements from Figma to Android Studio via the Relay plugin. Each time I attempt the import, I encounter the following error:
java.net.URISyntaxException: Illegal character in query at index 142: https://api.figma.com/v1/files/m8xNr5fWHgp7L3YvvX6ktJ/versions?page_size=30&column=date&secondary_column=default&after=2024-12-23 15:45:32 UTC&secondary_after=3287459755284937261
It seems like there’s a problem with the format of the URL in the API request. Is anyone else experiencing this? I’m currently using Android Studio Ladybug Feature Drop 2024.2.2 (Build #AI-242.23726.103.2422.12816248) with Relay for Android Studio version 0.3.12-final.
Any tips on resolving this issue would be greatly appreciated. Thank you!
check if your figma file name has special characters or spaces - that can mess up the api calls too. i had this happen when my file was named “design v2.1 final” and changing it to something simple like “design-v2” fixed the import issue completely.
had similar issue last month but slightly different fix - try updating your figma plugin first then restart AS. sometimes the version mismatch between figma relay plugin and studio plugin causes these url encoding problems. worked for me after struggling for days with this annoying error
I encountered this exact same URISyntaxException a few weeks ago and managed to resolve it. The problem is with URL encoding in the timestamp parameter. The space characters in “2024-12-23 15:45:32 UTC” aren’t being properly encoded by the Relay plugin, which causes the API request to fail. What worked for me was clearing the Relay plugin cache and restarting Android Studio completely. Go to File > Invalidate Caches and Restart, then select “Invalidate and Restart”. After the restart, try disconnecting and reconnecting your Figma account in the Relay settings. Sometimes the authentication tokens get corrupted and cause these URL formatting issues. If that doesn’t work, you might need to downgrade to Relay version 0.3.11 temporarily. I noticed version 0.3.12 introduced some API handling bugs that haven’t been fully resolved yet. The downgrade fixed the import process for several projects I was working on.
This URISyntaxException typically happens when the Relay plugin fails to properly encode query parameters in the Figma API request. I’ve seen this issue before and it’s often related to network proxy settings or firewall configurations that interfere with the plugin’s HTTP requests. Check if you’re behind a corporate proxy or VPN that might be modifying the request headers. In my case, temporarily disabling the VPN resolved the encoding issue. Also worth checking your Android Studio’s HTTP proxy settings under File > Settings > Appearance & Behavior > System Settings > HTTP Proxy. Make sure it’s set to “No proxy” or properly configured if you need one. The plugin sometimes struggles with URL encoding when routing through proxy servers that modify request parameters. If you’re still having trouble, try creating a fresh Figma access token from your account settings and re-authenticating in Android Studio.
This error indicates the Relay plugin is constructing malformed URLs with unescaped characters in the timestamp parameter. I ran into something similar when working with enterprise Figma accounts that had specific date formatting requirements. The issue typically occurs when the plugin tries to parse version history with timestamps containing spaces and special characters. Try switching to a different Figma file temporarily to test if the problem persists across all files or just specific ones. In my experience, files with extensive version histories or those created in different time zones tend to trigger this more frequently. You can also check your system locale settings since the timestamp format might be influenced by regional date/time preferences. Another workaround is to duplicate the problematic Figma file and try importing from the copy, which sometimes resolves the API parameter issues.