JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.59k stars 1.14k forks source link

Compose Multiplatform string resources: only accepting "strings.xml" #4572

Closed dbaroncelli closed 3 months ago

dbaroncelli commented 3 months ago

Describe the bug I tried to migrate some Android string resources to a Compose Multiplatform project. These are multiple xml string files. I get the error: GenerateResClassTask was failed: java.lang.IllegalStateException: Unknown resource type: 'values'.

The error goes away only if I keep 1 file named "strings.xml". It seems it only accepts strings resource files called "strings.xml"

Affected platforms I tried only on Desktop

Versions

To Reproduce Steps and/or the code snippet to reproduce the behavior:

  1. create multiple XML string resource files inside the folder "commonMain/composeResources/values"

Expected behavior it should work with no errors

Additional context The error goes away only if I keep 1 file named "strings.xml". It seems it only accepts strings resource files called "strings.xml"

terrakok commented 3 months ago

1) it was by design and described in the documentation 2) it was fixed in the latest dev builds

dbaroncelli commented 3 months ago

Does it mean in the next release, we can have multiple resource string files?

terrakok commented 3 months ago

yes

KevinnZou commented 2 months ago

@terrakok I also encountered a similar issue here. It does not allow us to have the custom resource folder. Is it possible to open this restriction?