I'm trying to update the libs I'm using to ones th...
# javascript
m
I'm trying to update the libs I'm using to ones that support 1.4-M1 in order to try the new IR compiler, but I'm getting errors like
Could not resolve org.jetbrains:kotlin-react:16.13.0-pre.95-kotlin-1.4-M1
for all of my libs, even though I have included the required maven repositories. The lib exists on the maven server: https://kotlin.bintray.com/kotlin-js-wrappers/org/jetbrains/kotlin-react/16.13.0-pre.95-kotlin-1.4-M1/ I'm including my full
build.gradle.kts
file. What am I doing wrong?
t
Valid repository list
Copy code
repositories {
        jcenter()
                maven("<https://kotlin.bintray.com/kotlin-js-wrappers>")
        maven("<https://kotlin.bintray.com/kotlin-eap>")
        maven("<https://kotlin.bintray.com/kotlin-dev>")
    }
m
Still getting the same error I'm afraid 😞
The interesting thing is that if I don't include
maven("<https://kotlin.bintray.com/kotlin-dev>")
in my repos list, then the Gradle sync "succeeds" with the following error:
Copy code
<ij_msg_gr>Gradle import errors<ij_msg_gr><ij_nav>C:\Users\Mike\IdeaProjects\MediaCastKotlinReceiver\build.gradle.kts<ij_nav><i><b>root project 'MediaCastKotlinReceiver': Unable to build Kotlin project configuration</b><eol>Details: org.gradle.internal.operations.BuildOperationQueueFailure: There was a failure while populating the build operation queue: Could not resolve all dependencies for configuration ':npm'.<eol>Caused by: org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':npm'.<eol>Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find org.jetbrains.kotlinx:kotlinx-html:0.7.2-build-1716.<eol>Required by:<eol>    project :</i>
Which makes sense, since
kotlinx-html
is in the
kotlin-dev
repo, but without it, it manages to find the other libs I'm using
t
Gradle 6+?
m
Yep, I'm using Gradle v6.3
Apparently this only happens with
kotlin.js.compiler=ir
in my
gradle.properties
file. After I removed it, I got some other errors about missing dependencies used by other libs (I expected that Gradle would automatically pull them, but it didn't), so I manually added them:
Copy code
implementation(npm("react-is", "16.13.0"))
implementation("org.jetbrains:kotlin-css:1.0.0-pre.95-kotlin-1.4-M1")
Now building with the old compiler works, but I still get the same error when trying the new compiler 😕
i
Hi, is Gradle build work? Can you run
./gradlew build
? Seems that it is https://youtrack.jetbrains.com/issue/KT-37705
m
No, it doesn't work
m
Oops, my bad. I thought that the latest version would also be compatible. Now I get a different error:
Copy code
e: java.lang.IllegalStateException: IrSimpleFunctionPublicSymbolImpl for public cast/PlayerManager.addEventListener|7803447740104203147[0] is already bound
This is from some code that
dukat
generated, but I guess that this is out of the original question's scope :P
i
Wow Just in case @bashor @[JB] Shagen
m
I commented any
addEventListener
functions I wasn't using as a workaround, and it now seems to work!
Here is the area it was complaining btw: https://github.com/Stonos/MediaCastKotlinReceiver/blob/6c8e7ece132019cd670157a816f8bf5f6ff70da8/src/main/kotlin/cast/cast.framework.kt#L72-L122 I had to make some modifications to dukat's output since it wouldn't compile, so it's possible that I messed it up. Here is the original typescript definition file: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chromecast-caf-receiver/cast.framework.d.ts
Anyway, my issue is solved 🙂 Great job on the new compiler guys! My production .js file went from 565 KB to 282 KB (a 50% reduction!)
👍 1