fleeksoft / ksoup

Ksoup is a Kotlin Multiplatform library for working with HTML and XML. It's a port of the renowned Java library Jsoup.
https://fleeksoft.github.io/ksoup/
Apache License 2.0
298 stars 12 forks source link

Unknown behavior when compiling `linuxX64` target: `Constructor 'URLBuilder.<init>' can not be called` #32

Closed Flyfish233 closed 2 months ago

Flyfish233 commented 3 months ago

Describe the bug

> Task :garden:linkReleaseExecutableLinuxX64
i: <com.fleeksoft.ksoup:ksoup> @ /Users/sabeeh/AndroidStudioProjects/ksoup/ksoup/src/commonMain/kotlin/com/fleeksoft/ksoup/internal/StringUtil.kt:248:16: Constructor 'URLBuilder.<init>' can not be called: No constructor found for symbol 'io.ktor.http/URLBuilder.<init>|<init>(io.ktor.http.URLProtocol;kotlin.String;kotlin.Int;kotlin.String?;kotlin.String?;kotlin.collections.List<kotlin.String>;io.ktor.http.Parameters;kotlin.String;kotlin.Boolean){}[0]'
i: <missing declarations>: No constructor found for symbol 'io.ktor.http/URLBuilder.<init>|<init>(io.ktor.http.URLProtocol;kotlin.String;kotlin.Int;kotlin.String?;kotlin.String?;kotlin.collections.List<kotlin.String>;io.ktor.http.Parameters;kotlin.String;kotlin.Boolean){}[0]'
<com.fleeksoft.ksoup:ksoup> @ /Users/sabeeh/AndroidStudioProjects/ksoup/ksoup/src/commonMain/kotlin/com/fleeksoft/ksoup/internal/StringUtil.kt:248:16: Constructor 'URLBuilder.<init>' can not be called: No constructor found for symbol 'io.ktor.http/URLBuilder.<init>|<init>(io.ktor.http.URLProtocol;kotlin.String;kotlin.Int;kotlin.String?;kotlin.String?;kotlin.collections.List<kotlin.String>;io.ktor.http.Parameters;kotlin.String;kotlin.Boolean){}[0]'

<missing declarations>: No constructor found for symbol 'io.ktor.http/URLBuilder.<init>|<init>(io.ktor.http.URLProtocol;kotlin.String;kotlin.Int;kotlin.String?;kotlin.String?;kotlin.collections.List<kotlin.String>;io.ktor.http.Parameters;kotlin.String;kotlin.Boolean){}[0]'

To Reproduce

Steps to reproduce the behavior:

  1. Use Ksoup in Kotlin Native project, linuxX64() target.
  2. Run gradle linkReleaseExecutableLinuxX64or any related task.
  3. FAILURE: Build failed with an exception. with above output.

Expected behavior

Pass gradle build.

Device:

Additional context

Build.gradle.kts source sets:

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation(libs.ksoup)
                implementation(libs.ktor.client.encoding)
                implementation(libs.ktor.client.content.negotiation)
            }
        }
        val linuxX64Main by getting {
            dependencies {
                implementation(libs.ktor.client.curl)
            }
        }
    }
itboy87 commented 2 months ago

@Flyfish233 Hi, Can you please try the latest 0.1.4 version.

Flyfish233 commented 2 months ago

It still happening on 1.6.0-alpha1:


> Task :garden:compileKotlinLinuxX64
> Task :garden:linkReleaseExecutableLinuxX64
> Task :garden:linkDebugExecutableLinuxX64
i: <io.ktor:ktor-io> @ /mnt/agent/work/49d4a482a8522285/ktor-io/common/src/io/ktor/utils/io/internal/AwaitingSlot.kt:12:1: Abstract function 'tryResume' is not implemented in non-abstract class 'ClosedSlot'
i: <io.ktor:ktor-io> @ /mnt/agent/work/49d4a482a8522285/ktor-io/common/src/io/ktor/utils/io/internal/AwaitingSlot.kt:12:1: Abstract function 'resume' is not implemented in non-abstract class 'ClosedSlot'
i: <missing declarations>: No function found for symbol 'kotlinx.coroutines/CancellableContinuation.tryResume|tryResume(1:0;kotlin.Any?;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?){}[0]'

> Task :garden:linkReleaseExecutableLinuxX64
i: <io.ktor:ktor-io> @ /mnt/agent/work/49d4a482a8522285/ktor-io/common/src/io/ktor/utils/io/internal/AwaitingSlot.kt:12:1: Abstract function 'tryResume' is not implemented in non-abstract class 'ClosedSlot'
i: <io.ktor:ktor-io> @ /mnt/agent/work/49d4a482a8522285/ktor-io/common/src/io/ktor/utils/io/internal/AwaitingSlot.kt:12:1: Abstract function 'resume' is not implemented in non-abstract class 'ClosedSlot'
i: <missing declarations>: No function found for symbol 'kotlinx.coroutines/CancellableContinuation.tryResume|tryResume(1:0;kotlin.Any?;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?){}[0]'

> Task :garden:linuxX64Binaries
itboy87 commented 2 months ago

@Flyfish233 I think these are warnings from Ktor. Could you please confirm if it throws any errors?

itboy87 commented 2 months ago

@Flyfish233 its related to this: https://youtrack.jetbrains.com/issue/KTOR-7212 just make sure you are using coroutines version 1.8.1

itboy87 commented 2 months ago

@Flyfish233 This issue is not related to Ksoup; it is already using the correct version of Coroutines (1.8.1). Feel free to comment if you have any questions. Thanks.