DevSrSouza / svg-to-compose

Converts SVG and Android Vector Drawable in Compose Multiplatform source code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Static import of ImageVector.Builder cases compile error

nik-caspeco opened this issue · comments

commented

For a generated file:

..
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
..

public val Icons.Coin: ImageVector
    get() {
        if (_coin != null) {
            return _coin!!
        }
        _coin = Builder(
            name = "Coin",
            defaultWidth = 24.0.dp,
            defaultHeight = 24.0.dp,
      ..

The static import of the Builder here causes the following Compile Time Exception:

<classpath>/icons/CoinKt.java:5: error: cannot access Builder
import androidx.compose.ui.graphics.vector.ImageVector.Builder;
                                                      ^
  bad class file: /Users/nik/.gradle/caches/transforms-3/bd3521848bdffd1987d2b8593e215954/transformed/jetified-ui-1.3.0-api.jar(/androidx/compose/ui/graphics/vector/ImageVector$Builder.class)
    undeclared type variable: T
    Please remove or make sure it appears in the correct subdirectory of the classpath.

By removing the static import and using _coin = ImageVector.Builder( ... it works fine.

I'm also seeing this.

@joshuamking @nik-caspeco please take a look https://github.com/ComposeGears/Valkyrie

I made a clean and optimized export for ImageVector