Skip to content

Make compatible with Kotlin 1.5 #108

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

Closed
ilya-g opened this issue Apr 16, 2021 · 11 comments
Closed

Make compatible with Kotlin 1.5 #108

ilya-g opened this issue Apr 16, 2021 · 11 comments
Assignees
Milestone

Comments

@ilya-g
Copy link
Member

ilya-g commented Apr 16, 2021

The versions 0.1.0 and 0.1.1 are incompatible with Kotlin 1.5.0 due to the changes in the experimental Duration inline value class there, which is widely used in kotlinx-datetime.

When using these versions with Kotlin 1.5, users can observe the following stack traces:

kotlin.time.DurationKt.getNanoseconds(J)D
java.lang.NoSuchMethodError: kotlin.time.DurationKt.getNanoseconds(J)D
	at kotlinx.datetime.DateTimeUnit$TimeBased.<init>(DateTimeUnit.kt:54)
	at kotlinx.datetime.DateTimeUnit.<clinit>(DateTimeUnit.kt:108)

or

java.lang.NoSuchMethodError: ‘kotlinx.datetime.Instant kotlinx.datetime.Instant.plus-LRDsOJo(long)’
@ilya-g ilya-g added this to the 0.2.0 milestone Apr 16, 2021
@ilya-g ilya-g self-assigned this Apr 16, 2021
@ilya-g
Copy link
Member Author

ilya-g commented Apr 19, 2021

If anyone wants to try a preliminary version of kotlinx-datetime for Kotlin 1.5, it can be found in this maven repository https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(KotlinTools_KotlinxDatetime_Build_All),status:success,branch:kotlin-1-5,pinned:true/artifacts/content/maven/
under the coordinates
org.jetbrains.kotlinx:kotlinx-datetime:0.2.0-dev-303

@only-kuban
Copy link

@ilya-g Link not work. Please add link in maven repository. Or writen guide for install 0.2.0 kotlinx-datetime for kotlin 1.5. Please.

@hfhbd
Copy link
Contributor

hfhbd commented Apr 20, 2021

@only-kuban The link does not work with your browser, but with Gradle.

// build.gradle.kts
repositories {
    maven(url = "https://teamcity.jetbrains.com/guestAuth/app/rest/builds/buildType:(KotlinTools_KotlinxDatetime_Build_All),status:success,branch:kotlin-1-5,pinned:true/artifacts/content/maven/")
}
dependencies {
    implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.2.0-dev-303")
}

@only-kuban
Copy link

image
Not work gradle task for iosTest. Help please. Screenshot added.

@dkhalanskyjb
Copy link
Collaborator

@only-kuban could you show the actual error that you're getting? Your screenshot doesn't include the error, just some debug info.

@only-kuban
Copy link

@dkhalanskyjb yes, add screenshot
image

@dkhalanskyjb
Copy link
Collaborator

Thanks, @only-kuban! I was able to reproduce a problem, which could be the same as what you're experiencing. I'll @-mention you when we fix it.

@dkhalanskyjb
Copy link
Collaborator

There's now a new preview version:

Example:

repositories {
    maven(url = "https://teamcity.jetbrains.com/guestAuth/repository/download/KotlinTools_KotlinxDatetime_Build_All/3436908:id/maven/")
}
dependencies {
    implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.2.0-dev-310")
}

@only-kuban could you please check it out?

@only-kuban
Copy link

only-kuban commented Apr 23, 2021

@dkhalanskyjb after insert repo and implementation in build.gradle.kts and load gradle changes i have error in screenshot
image

@ilya-g
Copy link
Member Author

ilya-g commented Apr 27, 2021

The version 0.2.0 compatible with Kotlin 1.5 is available in maven central. Please update your dependencies if you used test builds from teamcity, as they will be cleaned up soon.

@ilya-g ilya-g closed this as completed Apr 27, 2021
@only-kuban
Copy link

Thanks, it's worked!

anthonymonori added a commit to anthonymonori/okio that referenced this issue Jun 24, 2021
- Updated versions.kotlin to 1.5.20
    - Changelog for 1.5.20: https://kotlinlang.org/docs/whatsnew1520.html
    - Changelog for 1.5.0: https://kotlinlang.org/docs/whatsnew15.html
    - Changelog for 1.4.30: https://kotlinlang.org/docs/whatsnew1430.html
- Updated kotlinx-datetime from 0.1.1 to 0.2.1 since Kotlin 1.5.0 depends on datetime > 0.2.0
    - Due to the changes to the experimental Duration inline value class; see: Kotlin/kotlinx-datetime#108
- Adjusted tests with the changes due to hardcoded values of some changes around the Kotlin JS/IR and Legacy JS apis

Signed-off-by: Antal János Monori <[email protected]>
anthonymonori added a commit to anthonymonori/okio that referenced this issue Jun 24, 2021
- Updated versions.kotlin to 1.5.20
    - Changelog for 1.5.20: https://kotlinlang.org/docs/whatsnew1520.html
    - Changelog for 1.5.0: https://kotlinlang.org/docs/whatsnew15.html
    - Changelog for 1.4.30: https://kotlinlang.org/docs/whatsnew1430.html
- Updated kotlinx-datetime from 0.1.1 to 0.2.1 since Kotlin 1.5.0 depends on datetime > 0.2.0
    - Due to the changes to the experimental Duration inline value class; see: Kotlin/kotlinx-datetime#108
- Adjusted tests with the changes due to hardcoded values of some changes around the Kotlin JS/IR and Legacy JS apis

Signed-off-by: Antal János Monori <[email protected]>
swankjesse pushed a commit to square/okio that referenced this issue Jun 30, 2021
- Updated versions.kotlin to 1.5.20
    - Changelog for 1.5.20: https://kotlinlang.org/docs/whatsnew1520.html
    - Changelog for 1.5.0: https://kotlinlang.org/docs/whatsnew15.html
    - Changelog for 1.4.30: https://kotlinlang.org/docs/whatsnew1430.html
- Updated kotlinx-datetime from 0.1.1 to 0.2.1 since Kotlin 1.5.0 depends on datetime > 0.2.0
    - Due to the changes to the experimental Duration inline value class; see: Kotlin/kotlinx-datetime#108
- Adjusted tests with the changes due to hardcoded values of some changes around the Kotlin JS/IR and Legacy JS apis

Signed-off-by: Antal János Monori <[email protected]>
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

4 participants