Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static import of ImageVector.Builder cases compile error #12

Open
nik-caspeco opened this issue Nov 9, 2022 · 2 comments
Open

Static import of ImageVector.Builder cases compile error #12

nik-caspeco opened this issue Nov 9, 2022 · 2 comments

Comments

@nik-caspeco
Copy link

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.

@joshuamking
Copy link

I'm also seeing this.

@egorikftp
Copy link

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

I made a clean and optimized export for ImageVector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants