https://kotlinlang.org logo
Join the conversationJoin Slack
Channels
100daysofcode
100daysofkotlin
100daysofkotlin-2021
advent-of-code
aem
ai
alexa
algeria
algolialibraries
amsterdam
android
android-architecture
android-databinding
android-studio
androidgithubprojects
androidthings
androidx
androidx-xprocessing
anime
anko
announcements
apollo-kotlin
appintro
arabic
argentina
arkenv
arksemdevteam
armenia
arrow
arrow-contributors
arrow-meta
ass
atlanta
atm17
atrium
austin
australia
austria
awesome-kotlin
ballast
bangladesh
barcelona
bayarea
bazel
beepiz-libraries
belgium
berlin
big-data
books
boston
brazil
brikk
budapest
build
build-tools
bulgaria
bydgoszcz
cambodia
canada
carrat
carrat-dev
carrat-feed
chicago
chile
china
chucker
cincinnati-user-group
cli
clikt
cloudfoundry
cn
cobalt
code-coverage
codeforces
codemash-precompiler
codereview
codingame
codingconventions
coimbatore
collaborations
colombia
colorado
communities
competitive-programming
competitivecoding
compiler
compose
compose-android
compose-desktop
compose-hiring
compose-ios
compose-mp
compose-ui-showcase
compose-wear
compose-web
connect-audit-events
corda
cork
coroutines
couchbase
coursera
croatia
cryptography
cscenter-course-2016
cucumber-bdd
cyprus
czech
dagger
data2viz
databinding
datascience
dckotlin
debugging
decompose
decouple
denmark
deprecated
detekt
detekt-hint
dev-core
dfw
docs-revamped
dokka
domain-driven-design
doodle
dsl
dublin
dutch
eap
eclipse
ecuador
edinburgh
education
effective-kotlin
effectivekotlin
emacs
embedded-kotlin
estatik
event21-community-content
events
exposed
failgood
fb-internal-demo
feed
firebase
flow
fluid-libraries
forkhandles
forum
fosdem
fp-in-kotlin
framework-elide
freenode
french
fritz2
fuchsia
functional
funktionale
gamedev
ge-kotlin
general-advice
georgia
geospatial
german-lang
getting-started
github-workflows-kt
glance
godot-kotlin
google-io
gradle
graphic
graphkool
graphql
graphql-kotlin
graviton-browser
greece
grpc
gsoc
gui
hackathons
hacktoberfest
hamburg
hamkrest
helios
helsinki
hexagon
hibernate
hikari-cp
hire-me
hiring
hongkong
hoplite
http4k
hungary
hyderabad
image-processing
india
indonesia
inkremental
intellij
intellij-plugins
intellij-tricks
internships
introduce-yourself
io
ios
iran
israel
istanbulcoders
italian
jackson-kotlin
jadx
japanese
jasync-sql
java-to-kotlin-refactoring
javadevelopers
javafx
javalin
javascript
jdbi
jhipster-kotlin
jobsworldwide
jpa
jshdq
juul-libraries
jvm-ir-backend-feedback
jxadapter
k2-early-adopters
kaal
kafka
kakao
kalasim
kapt
karachi
karg
karlsruhe
kash_shell
kaskade
kbuild
kdbc
kgen-doc-tools
kgraphql
kinta
klaxon
klock
kloudformation
kmdc
kmm-español
kmongo
knbt
knote
koalaql
koans
kobalt
kobweb
kodein
kodex
kohesive
koin
koin-dev
komapper
kondor-json
kong
kontent
kontributors
korau
korean
korge
korim
korio
korlibs
korte
kotest
kotest-contributors
kotless
kotlick
kotlin-asia
kotlin-beam
kotlin-by-example
kotlin-csv
kotlin-data-storage
kotlin-foundation
kotlin-fuel
kotlin-in-action
kotlin-inject
kotlin-latam
kotlin-logging
kotlin-multiplatform-contest
kotlin-mumbai
kotlin-native
kotlin-pakistan
kotlin-plugin
kotlin-pune
kotlin-roadmap
kotlin-samples
kotlin-sap
kotlin-serbia
kotlin-spark
kotlin-szeged
kotlin-website
kotlinacademy
kotlinbot
kotlinconf
kotlindl
kotlinforbeginners
kotlingforbeginners
kotlinlondon
kotlinmad
kotlinprogrammers
kotlinsu
kotlintest
kotlintest-devs
kotlintlv
kotlinultimatechallenge
kotlinx-datetime
kotlinx-files
kotlinx-html
kotrix
kotson
kovenant
kprompt
kraph
krawler
kroto-plus
ksp
ktcc
ktfmt
ktlint
ktor
ktp
kubed
kug-leads
kug-torino
kvision
kweb
lambdaworld_cadiz
lanark
language-evolution
language-proposals
latvia
leakcanary
leedskotlinusergroup
lets-have-fun
libgdx
libkgd
library-development
linkeddata
lithuania
london
losangeles
lottie
love
lychee
macedonia
machinelearningbawas
madrid
malaysia
mathematics
meetkotlin
memes
meta
metro-detroit
mexico
miami
micronaut
minnesota
minutest
mirror
mockk
moko
moldova
monsterpuzzle
montreal
moonbean
morocco
motionlayout
mpapt
mu
multiplatform
mumbai
munich
mvikotlin
mvrx
myndocs-oauth2-server
naming
navigation-architecture-component
nepal
new-mexico
new-zealand
newname
nigeria
nodejs
norway
npm-publish
nyc
oceania
ohio-kotlin-users
oldenburg
oolong
opensource
orbit-mvi
osgi
otpisani
package-search
pakistan
panamá
pattern-matching
pbandk
pdx
peru
philippines
phoenix
pinoy
pocketgitclient
polish
popkorn
portugal
practical-functional-programming
proguard
prozis-android-backup
pyhsikal
python
python-contributors
quasar
random
re
react
reaktive
realm
realworldkotlin
reductor
reduks
redux
redux-kotlin
refactoring-to-kotlin
reflect
refreshversions
reports
result
rethink
revolver
rhein-main
rocksdb
romania
room
rpi-pico
rsocket
russian
russian_feed
russian-kotlinasfirst
rx
rxjava
san-diego
science
scotland
scrcast
scrimage
script
scripting
seattle
serialization
server
sg-user-group
singapore
skia-wasm-interop-temp
skrape-it
slovak
snake
sofl-user-group
southafrica
spacemacs
spain
spanish
speaking
spek
spin
splitties
spotify-mobius
spring
spring-security
squarelibraries
stackoverflow
stacks
stayhungrystayfoolish
stdlib
stlouis
strife-discord-lib
strikt
students
stuttgart
sudan
swagger-gradle-codegen
swarm
sweden
swing
swiss-user-group
switzerland
talking-kotlin
tallinn
tampa
teamcity
tegal
tempe
tensorflow
terminal
test
testing
testtestest
texas
tgbotapi
thailand
tornadofx
touchlab-tools
training
tricity-kotlin-user-group
trójmiasto
truth
tunisia
turkey
turkiye
twitter-feed
uae
udacityindia
uk
ukrainian
uniflow
unkonf
uruguay
utah
uuid
vancouver
vankotlin
vertx
videos
vienna
vietnam
vim
vkug
vuejs
web-mpp
webassembly
webrtc
wimix_sentry
wwdc
zircon
Powered by Linen
eap
  • n

    Nikita

    08/14/2019, 9:20 AM
    📣 1.3.50-EAP3 is available! The build number is
    1.3.50-eap-86
    and it’s available in the
    kotlin-eap
    Bintray repository and EAP IDE plugin channel. What’s new: https://github.com/JetBrains/kotlin/releases/tag/v1.3.50-eap-86 How to get it: https://discuss.kotlinlang.org/t/kotlin-1-3-50-early-access-preview/13525
    🎉 14
    l
    • 2
    • 1
  • s

    Sam Schilling

    09/19/2019, 3:27 PM
    Anyone know how to pull in a dev build with gradle?
    r
    n
    • 3
    • 31
  • j

    jw

    09/27/2019, 3:08 AM
    i'm trying to test some of the latest dev builds in order to verify the fixes prior to the first eap. but Gradle just hangs when it reaches a kotlin task. the logs indicate it starts a Kotlin daemon and connects but then it just sits there after getting the options. is anyone testing dev builds with a successful setup? haven't had luck with in-process either.
    a
    n
    • 3
    • 5
  • b

    basher

    10/31/2019, 12:54 PM
    Do KotlinX serialization and coroutines libs come out with EAPs usually? Our main trouble testing these is we have to recompile 7 libs for each update, and 2 of them are these. I'd be willing to add some automation to that, if I could count on kotlinx libs
    k
    s
    y
    • 4
    • 7
  • y

    yan

    01/13/2020, 2:16 PM
    1.3.70 EAP 1 (
    1.3.70-eap-42
    ) is available! You can find all the information in the discuss thread. Lots of improvements for .gradle.kts IDE support and Kotlin/JavaScript inside! https://discuss.kotlinlang.org/t/kotlin-1-3-70-early-access-preview/15876
    👍 3
    🔥 3
    🎉 18
    s
    s
    +2
    • 5
    • 15
  • y

    yan

    02/03/2020, 4:30 PM
    1.3.70 EAP 2 is out! Artifact version:
    1.3.70-eap-184
    . You can find the list of changes in the changelog: https://github.com/JetBrains/kotlin/releases/tag/v1.3.70-eap-184.
    🎉 7
    n
    d
    +2
    • 5
    • 8
  • s

    Sinan Kozak

    02/08/2020, 12:28 PM
    There is a code formatter change in 1.3.70-eap-184-Studio-4.0-1p about method chains. Code formatter accept property access as methods. It is most of the time acceptable and help readability. But it creates ugly results for Android R file usage. I have created this ticket for this. https://youtrack.jetbrains.com/issue/KT-36387 Is it possible to keep old behaviour or improve it for field access?
    👀 1
    • 1
    • 1
  • y

    yan

    02/20/2020, 11:06 AM
    1.3.70 EAP 3 is out! Artifact version:
    1.3.70-eap-274
    . You can find the list of changes in the changelog: https://github.com/JetBrains/kotlin/releases/tag/v1.3.70-eap-274.
    🎉 11
    o
    l
    • 3
    • 3
  • r

    russhwolf

    03/01/2020, 6:45 PM
    FYI I was having trouble building Multiplatform Settings on the latest eap, apparently due to the metadata compilation step introduced in https://youtrack.jetbrains.com/issue/KT-31411. I haven’t yet been able to create an isolated reproducer, but you can see an example failing build output here https://dev.azure.com/russhwolf/Multiplatform%20Settings/_build/results?buildId=80&view=logs&j=a82d9e72-1de4-5bd6-c188-90296135479e&t=07390922-4a60-504f-a9c0-7585a3d4f188. I was able to work around by removing
    kotlin.mpp.enableGranularSourceSetsMetadata=true
    from
    gradle.properties
    a
    s
    • 3
    • 3
  • g

    GarouDan

    03/02/2020, 9:06 PM
    Hello everyone, I’m receiving a message when using Intellij EAP:
    Please consider switching to the bundled Java runtime that is better suited for the IDE (your current Java runtime is 1.8.0_181-b13 by Oracle Corporation).
    I’m using
    IntelliJ IDEA 2020.1 EAP
    , do you know which is the Java version will suit this version more? And what is the best way to change it? Is it using the Choose Runtime plugin?
    n
    a
    • 3
    • 4
  • a

    Alina Dolgikh [JB]

    04/01/2020, 3:10 PM
    📣 Hi everyone! Kotlin 1.4-M1 is now available. It’s the first preview version of the major 1.4 release. If you’d like to learn more about what you can expect to find in it, please check out our blog post https://blog.jetbrains.com/kotlin/2020/03/kotlin-1-4-m1-released/ If you’re ready to install the new build right away, here are some instructions to help you get set up https://kotlinlang.org/eap/
    👍 9
    ❤️ 3
    n
    • 2
    • 2
  • z

    Zach Klippenstein (he/him) [MOD]

    04/08/2020, 4:55 PM
    I am trying to build a project with 1.4-M1, and getting a strange type error that I think might be a bug. I will file, but want to get a sanity check first. Here’s a simple reproducer, discussion in thread.
    data class FunctionHolder<out T : Any>(
      val f: (@UnsafeVariance T) -> Unit
    )
    
    fun caller(holder: FunctionHolder<*>) {
      val f: (Any) -> Unit = holder.f
    }
    t
    • 2
    • 23
  • a

    andrewoma

    05/11/2020, 2:51 AM
    Hi, is
    1.3.7x
    the last of the
    1.3
    series before
    1.4
    ? Curious as to why https://youtrack.jetbrains.com/issue/KT-37765 is only fixed on
    1.4+
    s
    • 2
    • 4
  • c

    christophsturm

    05/11/2020, 1:56 PM
    does it make sense to report bugs in 1.4-m1?
    :yes: 4
    👍 1
    e
    • 2
    • 3
  • g

    GarouDan

    05/13/2020, 3:19 AM
    How can we use
    Kotlin 1.4-M2
    when compiling the
    buildSrc
    module classes? I’m using the latest stable Gradle version (6.4) but it looks like it is not enough (Gradle is using 1.3.71). I’m receiving the following error:
    Class 'org.jetbrains.kotlin.konan.target.KonanTarget' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
    l
    • 2
    • 4
  • s

    stanislav.erokhin

    06/04/2020, 12:16 PM
    message has been deleted
    👍 6
    💥 17
    🎉 7
    s
    • 2
    • 1
  • e

    egorand

    06/04/2020, 11:05 PM
    I'd really like to start using the Gradle plugin niceties introduced in 1.4-M2, but would like to avoid shipping code that depends on the stdlib of that version. Is it just a matter of declaring different versions for the plugin and the libraries, would this work?
    g
    • 2
    • 1
  • c

    christophsturm

    06/05/2020, 9:02 AM
    is there a way to enable the explicit api mode only for the main source set and not the test source set?
    e
    • 2
    • 2
  • e

    egorand

    06/05/2020, 10:18 PM
    Is there a way to batch-fix explicit API mode warnings for the entire project? Alt + Enter seems to only provide quick fixes for a specific declaration
    l
    • 2
    • 1
  • l

    louiscad

    06/07/2020, 4:31 PM
    Should the value of
    kotlin.native.enableDependencyPropagation
    really be
    false
    , or is that a mistake, and I should set it to
    true
    to enable platform-dependent libraries in shared source sets? Screenshot taken from Kotlin 1.4-M2 blog post (https://blog.jetbrains.com/kotlin/2020/06/kotlin-1-4-m2-released)
    d
    • 2
    • 2
  • l

    louiscad

    06/07/2020, 8:52 PM
    [Solved] Another question related to me trying to try 1.4-M2 in a project: I get unresolved references for these 2 classes:
    org.jetbrains.kotlin.konan.target.Family
    and
    org.jetbrains.kotlin.konan.target.HostManager
    . It's very confusing because IntelliJ sees them in the file
    kotlin-compiler-embeddable-1.4-M2.jar
    from the
    org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4-M2
    dependency that I get transitively from the explicit dependency on
    org.jetbrains.kotlin:kotlin-gradle-plugin:1.4-M2
    , but they're red, and compilation from command line fails (it's a plugin that is an includedBuild). Were these classes kinda removed in a weird way? It was working alright in 1.3. Thanks for your help!
    t
    • 2
    • 4
  • j

    jakiej

    06/08/2020, 7:54 PM
    just curious, what is
    ml completion for kotlin
    ?
    g
    g
    • 3
    • 4
  • g

    GarouDan

    06/10/2020, 12:03 AM
    I’m using EAP and I’m having the following error:
    Incompatible Kotlin/Native libraries
    There are 549 libraries libraries from the Kotlin/Native 1.3.72 distribution attached to the project: stdlib, ARKit, ARKit, ARKit, AVFoundation, ...
    These libraries were compiled with an older Kotlin/Native compiler and can't be read in IDE.
    Please edit Gradle buildfile(s) to use Kotlin Gradle plugin version 1.4-M2. Then re-import the project in IDE.
    My project is already using
    1.4-M2
    , as suggested, but I suppose the problem comes from Gradle, since
    6.5
    (latest) version points to
    1.3.72
    . Does someone know what we can do about it? How can we configure the project to avoid this error? I’m not sure, but I’m facing a issue where the run/debug buttons are not working as well. I’m using the latest IntelliJ EAP
    g
    a
    l
    • 4
    • 15
  • a

    arthur.n

    06/10/2020, 12:14 PM
    Hey everyone! Quick newb question regarding
    1.4-M2
    : Will I be able to use Ktor
    1.3.2-1.4-M1
    with a
    1.4-M2
    project setup (
    serialization
    and
    coroutines
    are
    1.4-M2
    ones)? Or I'll have to wait for the new Ktor release
    p
    r
    • 3
    • 3
  • r

    rscorer

    06/15/2020, 2:44 PM
    I upgraded my little app to be 1.4-M2 and had to roll back to 1.4-M1 as I got this error at runtime:
    Exception in thread "main" java.lang.NoSuchMethodError: 'kotlinx.serialization.CompositeEncoder kotlinx.serialization.Encoder.beginStructure(kotlinx.serialization.SerialDescriptor)'
    @Serializable
    data class EmailData(val email: String)
    
    @Serializable
    data class ToList(val to: List<EmailData>)
    
    @Serializable
    data class FromList(val from: EmailData)
    
    @Serializable
    data class EmailContentType(val type: String, val value: String)
    
    @Serializable
    data class Data(val personalizations: List<ToList>, val from: EmailData, val subject: String, val content: List<EmailContentType>)
    
    @Suppress("EXPERIMENTAL_API_USAGE")
    class Mailer {
        val sendGridApiKey = System.getenv("SENDGRIDAPIKEY")
        val JSON = "application/json; charset=utf-8".toMediaType()
        val sendGridRecipient = System.getenv("SENDGRIDEMAILADDR")
        val gson = Gson()
    
        fun sendmail(subject: String, content: String): String {
            val email = EmailData(sendGridRecipient)
            val data = Data(listOf(ToList(listOf(email))), email, subject, listOf(EmailContentType("text/plain", content)))
            val json = Json.stringify(Data.serializer(), data)
    a
    • 2
    • 5
  • c

    Chintan Soni

    06/28/2020, 4:11 AM
    Hey Team,, I tried to work with KMP project with plugin version: 1.4-M2 I am trying to create a service layer with ktor version: 1.3.2-1.4-M2 But it couldn’t find any modules of ktor of this version:
    plugins {
        kotlin("multiplatform") version "1.4-M2"
    }
    group = "dev.chintansoni"
    version = "1.0-SNAPSHOT"
    
    repositories {
        mavenCentral()
        maven {
            url = uri("<https://dl.bintray.com/kotlin/kotlin-eap>")
        }
        maven {
            url = uri("<https://kotlin.bintray.com/ktor>")
        }
    }
    kotlin {
        jvm {
            compilations.all {
                kotlinOptions.jvmTarget = "1.8"
            }
        }
        js {
            nodejs()
            browser()
        }
        val hostOs = System.getProperty("os.name")
        val isMingwX64 = hostOs.startsWith("Windows")
        val nativeTarget = when {
            hostOs == "Mac OS X" -> macosX64("native") {
                binaries.framework {
                    baseName = "MacOSDomain"
                }
            }
            hostOs == "Linux" -> linuxX64("native")
            isMingwX64 -> mingwX64("native")
            else -> throw GradleException("Host OS is not supported in Kotlin/Native.")
        }
    
        sourceSets {
            val ktorVersion = "1.3.2-1.4-M2"
            val commonMain by getting {
                dependencies {
                    implementation(kotlin("stdlib-common"))
                    implementation("io.ktor:ktor-client-core:$ktorVersion")
                    implementation("io.ktor:ktor-client-json:$ktorVersion")
                    implementation("io.ktor:ktor-client-logging:$ktorVersion")
                    implementation("io.ktor:ktor-client-serialization:$ktorVersion")
                }
            }
            val commonTest by getting {
                dependencies {
                    implementation(kotlin("test-common"))
                    implementation(kotlin("test-annotations-common"))
                }
            }
            val jvmMain by getting {
                dependencies {
                    implementation(kotlin("stdlib-jdk8"))
                }
            }
            val jvmTest by getting {
                dependencies {
                    implementation(kotlin("test-junit"))
                }
            }
            val jsMain by getting {
                dependencies {
                    implementation(kotlin("stdlib-js"))
                }
            }
            val jsTest by getting {
                dependencies {
                    implementation(kotlin("test-js"))
                }
            }
            val nativeMain by getting {}
            val nativeTest by getting {}
        }
    }
    It gives me error:
    Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
    Could not resolve org.jetbrains.kotlinx:atomicfu:0.14.3-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
    Could not resolve org.jetbrains.kotlinx:atomicfu:0.14.3-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7-1.4-M2
    Could not resolve org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0-1.4-M2
    Can someone please help me with it?
    n
    • 2
    • 4
  • n

    naitbit

    07/06/2020, 5:24 PM
    After trying 1.4-M3 I get
    A problem occurred configuring project ':app'.
    > In non-Android projects, Kotlin compilation should not be null
    AFAIK it comes from Kapt It seems to come from Kapt https://jar-download.com/artifacts/org.jetbrains.kotlin/kotlin-gradle-plugin/1.2.71/source-code/org/jetbrains/kotlin/gradle/internal/kapt/Kapt3KotlinGradleSubplugin.kt but I don't know why (and why it is the problem only in EAP)
    a
    n
    • 3
    • 7
  • c

    christophsturm

    07/06/2020, 6:39 PM
    when i update my multiproject project that uses
    js(IR)
    to M3 i get this stacktrace when building:
    > Task :compileTestDevelopmentExecutableKotlinJs FAILED
    e: java.lang.AssertionError: Unbound symbols at the end of linker
    Unbound public symbol for public kotlinx.serialization/SerialDescriptor.name.<get-name>|5879344792307730109[0] public kotlinx.serialization/SerialDescriptor.name.<get-name>|5879344792307730109[0]
            at org.jetbrains.kotlin.ir.util.SymbolTableKt.noUnboundLeft(SymbolTable.kt:962)
            at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile(compiler.kt:73)
            at org.jetbrains.kotlin.ir.backend.js.CompilerKt.compile$default(compiler.kt:48)
            at org.jetbrains.kotlin.cli.js.K2JsIrCompiler.doExecute(K2JsIrCompiler.kt:221)
            at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:181)
            at org.jetbrains.kotlin.cli.js.K2JSCompiler.doExecute(K2JSCompiler.java:74)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:86)
            at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
            at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
            at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1549)
            at jdk.internal.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
            at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.base/java.lang.reflect.Method.invoke(Method.java:564)
            at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
            at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
            at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
            at java.base/java.security.AccessController.doPrivileged(AccessController.java:691)
            at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:587)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:828)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:705)
            at java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
            at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:704)
            at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
            at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
            at java.base/java.lang.Thread.run(Thread.java:832)
    ✅ 1
    d
    r
    • 3
    • 4
  • c

    christophsturm

    07/08/2020, 9:30 AM
    if i create a new mpp project with the 1.4-m3 wizard (jvm and js), and then add a distributions block to the gradle file, idea complains about it. the gradle file works fine.
    g
    a
    • 3
    • 8
  • s

    Skolson5903

    07/09/2020, 8:37 PM
    Just downloaded and started trying M3. Am an Android Studio user, so installed current Intellij Idea also so I could try out the new MPP project wizard. I created a new project in Idea for targets IOS and Android. I added two additional MP modules for a total of five modules in the project(I changed the common module names); iosApp, androidApp, ioCommon, jillcess, monayCommon. The last three modules are all multiplatform, intended for use by both iosApp and androidApp. monayCommon will dependsOn ioCommon and jillcess. The wizard generated all of the directories and related gradle files, then I noticed that each of the three multiplatform modules had the same issue: androidMain and androidTest subdirectories of src are not recognized by Idea as sourceSets, In each of the modules, the src subdirectory had these subs built by the wizard (as expected).
    src
            androidMain
            androidTest
            commonMain
            commonTest
            iosMain
            iosTest
    I manually added a buildSrc setup, just an FYI, don't think it's relevant to the question. In order to add dependencies for each of the environments, I ended up having to add this snippet to the kotlin sourceSets definition to add these as sourceSets:
    val androidMain by creating {
            dependsOn(commonMain)
            dependencies {
                ...
            }
        }
        val androidTest by creating {
            dependsOn(commonMain)        dependencies {
                ...
            }
        }
    commonMain and commonTest were already sourceSets, so I could use the "by getting" clause to work with those. But androidMain and androidTest were not according to gradle, so "by creating" was required. Once I did this, after resync Idea and gradle both show them as sourceSets, but not quite identically. See attached file to see what the Idea project window shows after the above. Is this expected behavior? Seems like if these dirs gets created by the wizard, the android directories should also be configured as sourcesets like the common and IOS stuff is. Also my gradle skills are poor, so I'm having trouble getting androidTest to be treated as a unit test sourceSet. I'm using Kotest 4.1.1 in the ioCommon.androidTest directory (testing code in commonMain) and am having trouble running unit tests in debug from the IDE because of various gradle-related classpath issues. So my build.gradle.kts is still not correct for what I need. I'd appreciate any info if I'm doing something wrong. Am also willing to send whatever would be helpful if this really is an actual issue. The project has very little source in it as of yet, so it is easy to try changes until the setup is correct. So if anyone has suggestions of stuff to try, I can also do those. Thanks in advance forr any info...
    r
    • 2
    • 16
Powered by Linen
Title
s

Skolson5903

07/09/2020, 8:37 PM
Just downloaded and started trying M3. Am an Android Studio user, so installed current Intellij Idea also so I could try out the new MPP project wizard. I created a new project in Idea for targets IOS and Android. I added two additional MP modules for a total of five modules in the project(I changed the common module names); iosApp, androidApp, ioCommon, jillcess, monayCommon. The last three modules are all multiplatform, intended for use by both iosApp and androidApp. monayCommon will dependsOn ioCommon and jillcess. The wizard generated all of the directories and related gradle files, then I noticed that each of the three multiplatform modules had the same issue: androidMain and androidTest subdirectories of src are not recognized by Idea as sourceSets, In each of the modules, the src subdirectory had these subs built by the wizard (as expected).
src
        androidMain
        androidTest
        commonMain
        commonTest
        iosMain
        iosTest
I manually added a buildSrc setup, just an FYI, don't think it's relevant to the question. In order to add dependencies for each of the environments, I ended up having to add this snippet to the kotlin sourceSets definition to add these as sourceSets:
val androidMain by creating {
        dependsOn(commonMain)
        dependencies {
            ...
        }
    }
    val androidTest by creating {
        dependsOn(commonMain)        dependencies {
            ...
        }
    }
commonMain and commonTest were already sourceSets, so I could use the "by getting" clause to work with those. But androidMain and androidTest were not according to gradle, so "by creating" was required. Once I did this, after resync Idea and gradle both show them as sourceSets, but not quite identically. See attached file to see what the Idea project window shows after the above. Is this expected behavior? Seems like if these dirs gets created by the wizard, the android directories should also be configured as sourcesets like the common and IOS stuff is. Also my gradle skills are poor, so I'm having trouble getting androidTest to be treated as a unit test sourceSet. I'm using Kotest 4.1.1 in the ioCommon.androidTest directory (testing code in commonMain) and am having trouble running unit tests in debug from the IDE because of various gradle-related classpath issues. So my build.gradle.kts is still not correct for what I need. I'd appreciate any info if I'm doing something wrong. Am also willing to send whatever would be helpful if this really is an actual issue. The project has very little source in it as of yet, so it is easy to try changes until the setup is correct. So if anyone has suggestions of stuff to try, I can also do those. Thanks in advance forr any info...
r

r4zzz4k

07/09/2020, 10:15 PM
Despite different markings on Android directories, it should still work as intended, does it? I mean navigation in code and resources and other stuff. I believe this is caused by specifics of how Android plugin for IDEA handles it's internal project model. This looks different even for usual single-platform JVM and Android projects, IIRC.
s

Skolson5903

07/11/2020, 6:43 PM
Hmm, I think you are right. The reason I went down this rabbit hole was difficulty with Kotest that I was blaiming on sourceSet issues. So today I started a clean new project in Intellij, with only one shared module. Here's the exact steps I've done so far:
Damn every time I hit enter it posts my note. I'm not used to Slack UI yet 🙂 I'll post one separate reply with my steps.
I'm guessing this is a known issue, but after create the initial sync fails:
IOException prevents gradle sync
I had to edit the generated local.properties line:
D:\Android\sdk to D:\\Android\\sdk
The generated one did not escape "\" properly (I'm on windows). After that sync works, except then I did these steps (mostly minor)
```
• Changed dependency on jdk7 to jdk8
• updated androidx.core:core-ktx:1.3.0 from 1.2.0 in shared
• inserted these in shard androidTest kotlin sourceSet
dependencies { implementation("io.kotest:kotest-core-jvm:4.1.1") implementation("io.kotest:kotest-assertions-core-jvm:4.1.1") implementation("io.kotest:kotest-runner-console-jvm:4.1.1") runtimeOnly("org.junit.jupiter:junit-jupiter-engine:5.6.2") }``` sync resulted with this:
11:30 AM   The IDE modules below were removed by the Gradle project reload:
                   shared.iosMain
                   shared.iosTest
                   shared.commonMain...
Do you know why this happens? I chose to open dialog and recover all 4. which created .iml files for the various shared modules - seems like an error. Anyway, forging ahead • Copied in three source files
2 kotlin files in commonMain
    1 kotlin file in androidTest (BasicsTest)
At this point the source files look like they will build fine - no syntax errors • Installed the newest Kotest plugin from the marketplace • Attempted to use Kotest plugin to run the one test in debug. Result:
Exception in thread "main" java.lang.ClassNotFoundException: BasicsTest
So maybe this is a Kotest plugin issue? As far as I can see the Gradle build triggered by the plugin doesn't compile the BasicsTest class, so it isn't on the classpath. Anyway I'm still experimenting. If you think this sounds more appropriate for posting in the kotest channel, lemme know...
r

r4zzz4k

07/11/2020, 7:05 PM
Didn't really work with kotest, so not sure. First, I'd try to run tests using
./gradlew
via terminal to check whether the project can be built and tests can be run by Gradle -- so it this IDE-only issue or not. It's also probably more logical to move to either #kotest or #multiplatform depending on the outcome.
s

Skolson5903

07/11/2020, 7:05 PM
One ore note, the Kotest plugin uses the "shard" module classpath for this. If I open the Edit Run Configuration dialog for this test class, and drop down the "use classpath of module" list, shared.AndroidTest isn't an option. shared.androidMain is not either.
Ok just saw your reply. Will dig in some more and then post in Kotest. Thanks!
Haven't been able to work on this until recently. Took your advice Andrew (thanks!) and have also simplified the problem setup. Steps now are: • Create new mobile app with the EAP plugin from 1.4-M3 • Add one test into commonTest. Can be anything, I created this one guaranteed to fail if it runs:
import kotlin.test.Test
    import kotlin.test.assertTrue
    
    class AnyTest {
        @Test
        fun failingTest() {
            assertTrue(false)
        }
    }
• Build project. This succeeds with the default gradle 6.3 and also 6.4.1. Fails on 6.5.1 so I left mine on 6.4.1, but 6.3 acts the same as 6.4.1 • Run check task. The project level "check", and the shared level "check" both fail with the same compile error:
> Task :shared:compileReleaseJavaWithJavac

> Task :shared:compileReleaseUnitTestKotlinAndroid FAILED
e: D:\WorkingIntelliJ\untitled\shared\src\commonTest\kotlin\FooTest.kt: (1, 20): Unresolved reference: Test
e: D:\WorkingIntelliJ\untitled\shared\src\commonTest\kotlin\FooTest.kt: (2, 20): Unresolved reference: assertTrue
e: D:\WorkingIntelliJ\untitled\shared\src\commonTest\kotlin\FooTest.kt: (5, 6): Unresolved reference: Test
e: D:\WorkingIntelliJ\untitled\shared\src\commonTest\kotlin\FooTest.kt: (7, 9): Unresolved reference: assertTrue
So despite gradle being able to build the project ok, and the IDE showing the test source buildable with no problem, for some reason gradle isn't seeing the "kotlin.test" classes during the test tasks. It looks to me like the wizard generates the correct dependencies in the commonTest sourceset:
val commonTest by getting {
            dependencies {
                implementation(kotlin("test-common"))
                implementation(kotlin("test-annotations-common"))
            }
        }
I'm unsure what can cause gradle to fail with a missing dependency running tests that it can compile/build just fine. Any suggestions where I should take this next?
More info, these test-specific build tasks also fail from the gradle console:
:shared:compileDebugAndroidTestSources
    :shared:compileDebugUnitTestKotlinAndroid
I was forgetting that project builds don't build tests. Sorry. Anyway, somehow the test builds are not using the commonTest dependencies for source in the commonTest sourceset.
r

r4zzz4k

07/19/2020, 7:12 PM
Does androidTest target have corresponding kotlin-test-junit (or something along those lines) dependency?
s

Skolson5903

07/21/2020, 6:36 PM
I left it exactly as the wizard generates it, so the current androidTest sourceSet in shared:build.gradle.kts is stubbed, just like the ios ones:
val androidTest by getting
        val iosMain by getting
        val iosTest by getting
I've got a base git commit of this guinea pig project that is all the files from the wizard without changes, I'm going to just focus on getting the one bogus multiplatform test to run next, and will commit useful changes, if I find any. If I find useful changes, I'll do granular commits with comments on each until (hopefully) I get a successful run of the shared:test task.
I added this to the shared module's build.gradle.kts to dump out the task and its inputs.
gradle.taskGraph.whenReady(closureOf<TaskExecutionGraph> {
    println("Found task graph: $this")
    println("Found " + allTasks.size + " tasks.")
    allTasks.forEach { task ->
        println(task)
        task.dependsOn.forEach { dep ->
            println("  - $dep")
        }
        task.inputs.files.forEach {
            println("Input - ${it.absolutePath}")
        }
    }
})
And running shard:test gradle task produced this for the failing subtask:
task ':shared:compileDebugUnitTestKotlinAndroid'
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-jdk7\1.4-M3\3d648cd3e9ac8cea2febc25dccd42fa2667fac75\kotlin-stdlib-jdk7-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\transforms-2\files-2.1\656cf8328a1f1d2fa1bdeb986a444437\core-ktx-1.2.0-api.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-test-common\1.4-M3\7b9619fe019c49b8d6991a348e9a84af7102e11b\kotlin-test-common-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-test-annotations-common\1.4-M3\23cc8a186707afc74a144ad3acd1ec840a6d0490\kotlin-test-annotations-common-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-android-extensions-runtime\1.4-M3\fba99da6f19ee1bf749fe1e32b26612ddd0bbca3\kotlin-android-extensions-runtime-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib\1.4-M3\d434fee0dcf45da74fbb897d7db3e24993e6be2c\kotlin-stdlib-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-stdlib-common\1.4-M3\9f0db946b8160929e99f26df2ae3e65356978141\kotlin-stdlib-common-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains\annotations\13.0\919f0dfe192fb4e063e7dacadee7f8bb9a2672a9\annotations-13.0.jar
Input - C:\Users\skols\.gradle\caches\transforms-2\files-2.1\61e1b3b81ccbb7a0671a1bba91af7b93\core-1.2.0-api.jar
Input - C:\Users\skols\.gradle\caches\transforms-2\files-2.1\bccb0d8a706b37d7233824b303cf1493\lifecycle-runtime-2.0.0-api.jar
Input - C:\Users\skols\.gradle\caches\transforms-2\files-2.1\b7c02a65a494426908f214e4c4207d13\versionedparcelable-1.1.0-api.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\androidx.lifecycle\lifecycle-common\2.0.0\e070ffae07452331bc5684734fce6831d531785c\lifecycle-common-2.0.0.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\androidx.arch.core\core-common\2.0.0\bb21b9a11761451b51624ac428d1f1bb5deeac38\core-common-2.0.0.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\androidx.collection\collection\1.0.0\42858b26cafdaa69b6149f45dfc2894007bc2c7a\collection-1.0.0.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\androidx.annotation\annotation\1.1.0\e3a6fb2f40e3a3842e6b7472628ba4ce416ea4c8\annotation-1.1.0.jar
Input - D:\WorkingIntelliJ\Mpp2\shared\build\intermediates\javac\debug\classes
Input - D:\WorkingIntelliJ\Mpp2\shared\build\tmp\kotlin-classes\debug
Input - D:\WorkingIntelliJ\Mpp2\shared\build\intermediates\compile_only_not_namespaced_r_class_jar\debug\R.jar
Input - D:\Android\sdk\platforms\android-29\android.jar
Input - D:\WorkingIntelliJ\Mpp2\shared\src\commonTest\kotlin\FooTest.kt
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-compiler-embeddable\1.4-M3\67dfdd73f5fdc275f857d9aab325bd205003fdd6\kotlin-compiler-embeddable-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-reflect\1.4-M3\a00dc5d9fe4c80832afd33c61310e9ad69d7af16\kotlin-reflect-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-script-runtime\1.4-M3\f41bf9bc6b35b83040eedcdd482651d2f843e12f\kotlin-script-runtime-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-daemon-embeddable\1.4-M3\b214990d2189e8eb24f79b4564f834023f8f7192\kotlin-daemon-embeddable-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.intellij.deps\trove4j\1.0.20181211\216c2e14b070f334479d800987affe4054cd563f\trove4j-1.0.20181211.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-scripting-compiler-embeddable\1.4-M3\4883c12980036982b3bf069c7fa4ab693befe237\kotlin-scripting-compiler-embeddable-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-android-extensions\1.4-M3\fcb9dabe0c5e505d2fe2d147e0ed005db31a279f\kotlin-android-extensions-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-scripting-compiler-impl-embeddable\1.4-M3\8b3469ce9d46ec8cc68e5ba1154b757df6527102\kotlin-scripting-compiler-impl-embeddable-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-scripting-jvm\1.4-M3\766489c2c88ab457ccd7b246163b35baad8feb97\kotlin-scripting-jvm-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlin\kotlin-scripting-common\1.4-M3\b1e0404ba3ecbc27b5fab4a2a2008ba827405e21\kotlin-scripting-common-1.4-M3.jar
Input - C:\Users\skols\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlinx\kotlinx-coroutines-core\1.3.7\8e2eb78158638b33793d204ffef0b65c4a578e1c\kotlinx-coroutines-core-1.3.7.jar
Digging though all that shows kotlin-test-common-1.4-M3.jar and kotlin-test-annotations-common-1.4-M3.jar as inputs, which I thought were the jars that contain the missing stuff. Still trying to figure out what's wrong...
Ok one last bit of info, cuz I think I'm stuck after this 🙂. I looked in the kotlin-test-common jar in the gradle cache that are inputs to this compile, and at a high level (file names and folders only) compared them to the 1.3.72 version. They contain almost identical files, with the exception that the 1.3.72 version contains an org/junit/Test.kotlin_metadata file that is not in the 1.4-M3 version. I'm basically clueless about what kotlin_metadata stuff contains, so could easily be reading this wrong. But it's the only diff I can see, so don't know if this is related to the build error or not. Any ideas what I should try next?
I've been unable to determine the root cause, so opened an issue: https://youtrack.jetbrains.com/issue/KT-40571
View count: 3