Converting SVG files: Exception Converting SVG resources

I am trying to import a very simple Figma UI:

https://www.figma.com/file/QuWh3drqvNDIz82mrYGGAU/ActionButton?node-id=0%3A1&t=7ZZQHvhAB6ZkeoBH-1

I am getting the following error:

Converting SVG files: Exception Converting SVG resources for component_1.

How do I fix this?

Your button component1 is pretty simple.
Manual export to svg seems to work fine.
What is the code you used that throwed this error ?

I have the same problem.
Did you to correct this?

1 Like

Same issue here.

In Figma added rectangle with rounded corners and a text over it. Created a component out of it and defined UI package in relay plugin (tap handler for the rectangle and text-content for the text.

Saved.

After importing UI package and trying to build I get the:
Converting SVG files: Exception Converting SVG resources for component_1.

1 Like

Found a solution to anyone that’s struggling.

My gradle initially had " id ‚Äėcom.google.relay‚Äô version ‚Äė0.3.05‚Äô " defined, this gave me this strange SVG error. I have reduced it to 0.3.00 and then got a less mysterious error where it stated that I need to configure my JAVA_HOME.

After I have set the JAVA_HOME on my windows in environment variables: C:\Program Files\Java\jre-1.8 (point to JRE or JDK) I cleaned and rebuilt the project and all was good.

2 Likes

I have the same issue too, and here is my solution.

First of all, I run the relay plugin on Windows, and when i just start to load the Google HelloCard relay demo, the gradle gives me this error.

* What went wrong:
Execution failed for task ':businessMod:generateDebugRelayCode'.
> A failure occurred while executing com.google.d2c.gradle.GenerateCode$GenerateCodeWorkAction
   > Converting SVG files: Exception Converting SVG resources for hello_card.
     The input line is too long.
     The syntax of the command is incorrect.

It looks like some .bat script goes wrong. And I also find the name of my project is C:\Users\User\Desktop\demos\relay-fix-android. Possibly I find the key.

Maybe the name has hyphens - , and command line with those on windows can be interpreted in a wrong way. After that, I just change the project name to a new one without hyphens, and everything works fine.

If anyone has this problem, this solution may be useful.

I have a similar problem and this is the error message I get. I have not been able to resolve it.

Execution failed for task ‚Äė:app:generateDebugRelayCode‚Äô.

A failure occurred while executing com.google.d2c.gradle.GenerateCode$GenerateCodeWorkAction
Converting SVG files: Exception Converting SVG resources for form_login.

I had a similar issue and I resolved it by installing openjdk-17-jdk(I am using ubuntu).
It seems Java is needed to convert the SVG resources.

Running into this same exact issue while trying to follow a sample tutorial.

Execution failed for task ‚Äė:app:generateDebugRelayCode‚Äô.

A failure occurred while executing com.google.d2c.gradle.GenerateCode$GenerateCodeWorkAction
Converting SVG files: Exception Converting SVG resources for news.

I have tried everything from invalidate/restart to using Java 17 to reverting to an older version of the Relay plugin and still this annoying error persists. Absolutely nothing I seem to try affects the error at all.