BKMbigo / solitaire-compose

A simple solitaire card game
https://bkmbigo.github.io/solitaire-compose/
11 stars 0 forks source link

XML Vector Drawables are not supported for Wasm target #1

Closed BKMbigo closed 11 months ago

BKMbigo commented 1 year ago

Issue (Pertains to the library compose-components-resources)

Vector drawables are not supported on web platforms (JS/WASM) as of Compose-Multiplatform 1.4.0-dev-wasm-08

compose-multiplatform-resources fixed the issue on JS platform only.

BKMbigo commented 1 year ago

Temporary Workaround

Use expect/actuals to implement a custom implementation on JS and WASM target. The workaround should be removed when SVG parsing is implemented on Web Platforms.

BKMbigo commented 1 year ago
Workaround 2

Since multiple dev versions of Compose-Multiplatform have been released, you can download a dev version of the library compose.components.resources and use it in your project. However, WASM support is still not yet added to the current dev versions making this workaround unapplicable to this project

The workaround would involve adding the following to the Project-Level Build.gradle.kts where 1.5.0-dev1074 is a newer dev version

allprojects {
   configurations.all {
        val conf = this
        conf.resolutionStrategy.eachDependency {
           if(requested.module.group.contains("compose.components.resources.js")) {
              useVersion("1.5.0-dev1074")
           }
        }
   }
}