Encountered unexpected Unexpected JSON Token error in Relay for Android while importing Figma link

I am trying to import Figma design into Android Studio for application development.

I tried to import a Figma component URL and it succeeded in importing but soon met with the following error below.

A screenshot shows successful import of figma components preview from URL before the error below occurs.

How do I resolve it ?

kotlinx.serialization.json.internal.JsonDecodingException: Unexpected JSON token at offset 632: Encountered an unknown key 'menu'.
Use 'ignoreUnknownKeys = true' in 'Json {}' builder to ignore unknown keys.
JSON input: .....22/esDR31xSG-6AGleN2tOklQ.ttf"
    },
    {
      "family": .....
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:24)
	at kotlinx.serialization.json.internal.JsonExceptionsKt.JsonDecodingException(JsonExceptions.kt:32)
	at kotlinx.serialization.json.internal.JsonReader.fail(JsonReader.kt:333)
	at kotlinx.serialization.json.internal.JsonReader.fail$default(JsonReader.kt:332)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeObjectIndex(StreamingJsonDecoder.kt:145)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeElementIndex(StreamingJsonDecoder.kt:88)
	at com.google.relay.androidstudio.plugin.fonts.Webfont$$serializer.deserialize(FontFetcher.kt:180)
	at com.google.relay.androidstudio.plugin.fonts.Webfont$$serializer.deserialize(FontFetcher.kt:180)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:63)
	at kotlinx.serialization.encoding.CompositeDecoder$DefaultImpls.decodeSerializableElement$default(Decoding.kt:479)
	at kotlinx.serialization.internal.ListLikeSerializer.readElement(CollectionSerializers.kt:80)
	at kotlinx.serialization.internal.AbstractCollectionSerializer.readElement$default(CollectionSerializers.kt:51)
	at kotlinx.serialization.internal.AbstractCollectionSerializer.merge(CollectionSerializers.kt:36)
	at kotlinx.serialization.internal.AbstractCollectionSerializer.deserialize(CollectionSerializers.kt:43)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableValue(AbstractDecoder.kt:41)
	at kotlinx.serialization.encoding.AbstractDecoder.decodeSerializableElement(AbstractDecoder.kt:63)
	at com.google.relay.androidstudio.plugin.fonts.WebfontList$$serializer.deserialize(FontFetcher.kt:176)
	at com.google.relay.androidstudio.plugin.fonts.WebfontList$$serializer.deserialize(FontFetcher.kt:176)
	at kotlinx.serialization.json.internal.PolymorphicKt.decodeSerializableValuePolymorphic(Polymorphic.kt:63)
	at kotlinx.serialization.json.internal.StreamingJsonDecoder.decodeSerializableValue(StreamingJsonDecoder.kt:33)
	at kotlinx.serialization.json.Json.decodeFromString(Json.kt:85)
	at com.google.relay.androidstudio.plugin.fonts.FontFetcher.downloadFonts(FontFetcher.kt:225)
	at com.google.relay.androidstudio.plugin.fonts.FontFetcher.downloadFontAssets(FontFetcher.kt:68)
	at com.google.relay.androidstudio.plugin.uipackage.UIPackageManager.importAndDownloadFonts(UIPackageManager.java:95)
	at com.google.relay.androidstudio.plugin.uipackage.UIPackageTasks$createImportAndDownloadFontsTask$1$run$$inlined$runReadAction$1.compute(actions.kt:66)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:928)
	at com.google.relay.androidstudio.plugin.uipackage.UIPackageTasks$createImportAndDownloadFontsTask$1.run(UIPackageTasks.kt:229)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)

Hello,
Same thing, I filled a report Google Issue Tracker if someone wants the details

Regards,
François

Also encountering this issue!

Thanks for the confirmation on the bug.

Also got this problem. Plz let me know if you have some solutions. Thx!

The issue is in progress, please wait

It seems like that the problem has been fixed. If you still have this problem, plz update your relay plugin in Android studio plugin settings. You can see a version of relay plugin which ends with a hotfix label. This plugin could generate compose code correctly.

1 Like

Facing same issue

Any updates on this? Facing the same issue.

Also encountering this issue!

Facing the same issue. Any update on this ?

Hi Team,

I am also facing the same issue. kindly help.

Relay version - 0.3.12-hotfix