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

[IMPROVEMENT] Upgrade to Ktor 2 #184

Open
rushiiMachine opened this issue May 13, 2022 · 14 comments
Open

[IMPROVEMENT] Upgrade to Ktor 2 #184

rushiiMachine opened this issue May 13, 2022 · 14 comments
Assignees
Labels
technical-improvement Technical improvements that will help to simplify further development of this project.

Comments

@rushiiMachine
Copy link

Ktor 2.0.0 dropped about a month ago and it's incompatible with Ktor 1.5 so an upgrade would be useful

@rushiiMachine rushiiMachine added the technical-improvement Technical improvements that will help to simplify further development of this project. label May 13, 2022
@cjguttormsson
Copy link

I've run into an issue due to this. I was getting java.lang.ClassNotFoundException: io.ktor.client.features.HttpTimeout, and it turns out that that's due to a conflict between the 1.x.x version of ktor (from skrape.it) and the 2.x.x version of ktor (which I was using directly). Updating to ktor 2 would be appreciated, so that I and others can use the latest versions of both libraries simultaneously.

@christian-draeger
Copy link
Collaborator

I will have a look this week

@aaulia
Copy link

aaulia commented Jul 15, 2022

Just want to chime in, that using Ktor 2.x.x with current version of skrape will broke AsyncFetcher and HttpFetcher (due to incompatibility mentioned by @cjguttormsson)

@christian-draeger
Copy link
Collaborator

Support will be released within the next few days.
I just merged a PR we already got a while ago. Means current Snapshot version will support ktor2 already

@christian-draeger
Copy link
Collaborator

released version 1.3.0-alpha.1 to maven central.
will play around with it a bit more and afterwards release 1.3.0

if anyone else wants to try out version 1.3.0-alpha.1 in the meantime, it would be greatly appreciated. :)

@iMemon
Copy link

iMemon commented Aug 3, 2022

I have experimented with 1.3.0-alpha.1 because my project was already using Ktor 2.0. Seems like it is working fine.
But I was getting the error mentioned in the following image

Screenshot 2022-08-04 at 3 16 34 AM

So I needed to add resources.excludes.add("mozilla/public-suffix-list.txt") in the packagingOptions

So now packagingOptions will be like this:

packagingOptions {
    resources.excludes.add("META-INF/DEPENDENCIES")
    resources.excludes.add("mozilla/public-suffix-list.txt")
  }

Then I checked if this error is occuring in previous version or not. Found that:

  • 1.1.6 needs only "META-INF/DEPENDENCIES"
  • After that we need to add both "META-INF/DEPENDENCIES" and "mozilla/public-suffix-list.txt"

@christian-draeger
Copy link
Collaborator

Thx for verifying

@cjguttormsson
Copy link

Just tried out 1.3.0-alpha.1, worked great for me!

@christian-draeger
Copy link
Collaborator

Great I will release as final 1.3.0 version soon

@UKMIITB
Copy link

UKMIITB commented Feb 11, 2023

@christian-draeger
When is the final version 1.3.0 coming out ?
I can still see only 1.3.0-alpha.1 in maven central

@slott
Copy link

slott commented Aug 23, 2023

Any news here? I just discovered scrape.it and 1.3.0-alpha.1 seems to work like a charm. Wondering whats holding up a proper release ?

@RoyalSWiSH
Copy link

RoyalSWiSH commented Dec 14, 2023

1.3.0-alpha.1 seems to work, but with 1.3.0-alpha.2 i get this duplicate class error (I use ktor 2.3.7 in the rest of my project, which might cause the conflict in skrapeit 1.2.2)

Duplicate class it.skrape.fetcher.ExtensionsKt found in modules skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$WhenMappings found in modules skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-alpha.2)
Duplicate class it.skrape.fetcher.ExtensionsKt$installBasicAuth$1 found in modules skrapeit-async-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-async-fetcher:1.3.0-alpha.2) and skrapeit-http-fetcher-1.3.0-alpha.2 (it.skrape:skrapeit-http-fetcher:1.3.0-al
...
packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
            // Error when importing skrapeit
            excludes += '/META-INF/DEPENDENCIES'
            excludes += 'mozilla/public-suffix-list.txt'
        }
    }

@christian-draeger
Copy link
Collaborator

Thanks for reporting. I will have a look when I find time.
If someone is open to send PR would be welcome.

@kqvanity
Copy link

@iMemon
packagingOptions is now deprecated at the latest Android Gradle plugin.

android {
    packaging {
        resources {
            excludes.addAll(listOf(
                "/META-INF/{AL2.0,LGPL2.1}",
                "/META-INF/DEPENDENCIES",
                "mozilla/public-suffix-list.txt"
            ))
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical-improvement Technical improvements that will help to simplify further development of this project.
Projects
None yet
Development

No branches or pull requests

10 participants