Kamel-Media / Kamel

Kotlin asynchronous media loading and caching library for Compose.
Apache License 2.0
595 stars 23 forks source link

Updated Ktor to 2.0.0-beta-1, Kotlin to 1.6.10, Coroutines to 1.6.0 #14

Closed cmota closed 2 years ago

cmota commented 2 years ago

This PR aims to fix #13.

While making this change I've also updated all the deprecated libraries 🙂 .

Syer10 commented 2 years ago

You could update this to Ktor 2.0.0 now that its released

cmota commented 2 years ago

Thank you for the heads up @Syer10! I've just updated to ktor 2.0.0 and AGP 7.1.3.

I also made your suggestion on HttpFetcher 🙂

dragossusi commented 2 years ago

Is this repository still maintained?

cmota commented 2 years ago

@dragossusi I'm using the branch that I've created with the Ktor 2.0.0 support and I'll keep updating it until another solution is around. I'm using it in a couple of apps, without any problem.

Unfortunately, I don't think the original author is maintaining it.

dragossusi commented 2 years ago

@cmota did you upload it to maven? I was thinking about creating a new image loading library like this one and make it available for all platforms(I'll make it use dev builds of compose-jb)

cmota commented 2 years ago

I didn't because only the author can publish the library. What I'm doing is using it locally.

luca992 commented 2 years ago

@cmota I found a bunch of issues with your fork causing the build to fail. I fixed them and further updated ktor and some plugins. https://github.com/cmota/Kamel/pull/1

I'm going to publish a different branch updated to kotlin 1.6.21 and the latest dev compose to a maven repo for anyone interested. I'll post it here when I'm done

alialbaali commented 2 years ago

Thanks everyone for their support. If you'd like to contribute to this project, please let me know so I can add you to the project as a collaborator.

cmota commented 2 years ago

Hello @luca992, can you share the issue? I've been using this without any problem for quite some time 🤔.

luca992 commented 2 years ago

If you build as is:

  1. gradlePluginPortal() isn't added to buildscript.repositories and it fails there
  2. Build fails if extra publishing properties aren't present (which isn't necessarily a bug, but it's easy enough to fix by doing as String -> as String? ?: "")
  3. The error: Minimum supported Gradle version is 7.2. Current version is 7.1.1. (I updated to 7.4.2)
  4. bodyAsChannel() uses the wrong import in HttpFetcher
  5. > Task :kamel-image:compileDebugKotlinAndroid FAILED
    e: /Users/lucaspinazzola/Projects/Kamel/kamel-image/src/androidMain/kotlin/io/kamel/image/fetcher/ResourcesFetcher.kt: (25, 12): Unresolved reference: ExperimentalIoApi
    e: /Users/lucaspinazzola/Projects/Kamel/kamel-image/src/androidMain/kotlin/io/kamel/image/fetcher/ResourcesFetcher.kt: (25, 12): An annotation argument must be a compile-time constant
    e: /Users/lucaspinazzola/Projects/Kamel/kamel-image/src/androidMain/kotlin/io/kamel/image/mapper/ResourcesIdMapper.kt: (10, 73): This annotation is not applicable to target 'type usage'
    e: /Users/lucaspinazzola/Projects/Kamel/kamel-image/src/androidMain/kotlin/io/kamel/image/mapper/ResourcesIdMapper.kt: (16, 68): Cannot find a parameter with this name: encodedPath
  6. android gradle plugin 7.1.3 fails with a strange must use a different android studio version.. I downgraded back to 7.0.4, which is what all compose-jb examples use
luca992 commented 2 years ago

I published a release of my fork here if anyone is waiting for this to be merged:

implementation("io.github.luca992.com.alialbaali.kamel:kamel-image:0.3.0-ktor2")