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

No static method onDownload(Lio/ktor/client/request/HttpRequestBuilder;Lkotlin/jvm/functions/Function3;)V #114

Open
faridsavarudin opened this issue Sep 5, 2024 · 1 comment

Comments

@faridsavarudin
Copy link

using ktor version 3.0.0-beta-2,
using kamel version 0.9.5

@composable
fun ImageLoader(url: String, desc: String, modifier: Modifier, contentScale: ContentScale) {
val imageResources = LocalImageResource.current

when (val resource = asyncPainterResource(url)) {
    is Resource.Loading -> {
        LoadingScreen()
    }
    is Resource.Success -> {
        val painter: Painter = resource.value
        Image(painter,
            contentDescription = desc,
            modifier = modifier,
            contentScale = contentScale)
    }
    is Resource.Failure -> {
        val fallbackPainter = imageResources.Company()
        Image(fallbackPainter,
            contentDescription = desc,
            modifier = modifier,
            contentScale = ContentScale.FillHeight)
    }
}

}

I always go to Resource.Failure, and got this message error

No static method onDownload(Lio/ktor/client/request/HttpRequestBuilder;Lkotlin/jvm/functions/Function3;)V

@luca992
Copy link
Member

luca992 commented Sep 5, 2024

You most likely will have to use the latest beta version if you want to use the beta version of ktor

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

2 participants