https://kotlinlang.org logo
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
benchmarks
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
confetti
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
lincheck
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
Title
t

Tobi

09/14/2018, 2:55 PM
I am using the following configuration in a
build.gradle.kts
with Kotlin 1.2.61 and Gradle wrapper 4.10.1:
buildscript {
    repositories {
        maven("<https://dl.bintray.com/kotlin/kotlin-dev>")
    }
}

repositories {
    maven("<https://dl.bintray.com/kotlin/kotlin-dev>")
}

plugins {
    id("org.gradle.kotlin.kotlin-dsl") version "0.18.3"
}
When I try to increase the version of
kotlin-dsl
to f.e.
0.18.4
or the latest
0.19.5
I get the following error:
Plugin [id: 'org.gradle.kotlin.kotlin-dsl', version: '0.18.4'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:0.18.4')
  Searched in the following repositories:
    Gradle Central Plugin Repository
What maven repository is missing here? Or, which combination of Kotlin and kotlin-dsl should work?
e

eskatos

09/14/2018, 2:59 PM
You should not change the version of that plugin. Just do:
plugins {
    `kotlin-dsl`
}
which is equivalent.
then Gradle will use the version of that plugin that works well with your Gradle version.
Note that this plugin is for writing Gradle plugins or build logic, e.g. in
buildSrc
or if you plan to publish a plugin. See https://docs.gradle.org/current/userguide/kotlin_dsl.html
t

Tobi

09/14/2018, 3:14 PM
I am using it in
buildSrc
to maintain the dependencies of my multi-module project. Nevertheless, I would like to have control of the
kotlin-dsl
version. I cannot let Gradle pull in a
-RC
or
-alpha
or
-beta
in an production environment.
e

eskatos

09/14/2018, 3:16 PM
You can’t change the version of the Gradle Kotlin DSL, it is embedded in Gradle. And the Gradle Kotlin DSL knows which version of the
kotlin-dsl
plugin to use.
n

Nikky

09/14/2018, 3:54 PM
i would be interested in how you manage versions of dependencies i just use
allprojects {
    configurations.all {
        resolutionStrategy.eachDependency {
            if (requested.group == "org.jetbrains.kotlin") {
                useVersion(kotlin_version)
                because("version mix-matching annoys me")
            }
        }
    }
}
t

Tobi

09/14/2018, 9:22 PM
Can you explain why I cannot change the version? I can define different versions such as
id("org.gradle.kotlin.kotlin-dsl") version "0.18.0"
or
id("org.gradle.kotlin.kotlin-dsl") version "0.18.3"
although it is tight to the Gradle wrapper defined in the project (if I understand you correctly).
@eskatos I really would like to understand it.
e

eskatos

09/18/2018, 5:55 PM
yes, you can change the version, but you shouldn’t behavior is not guaranteed if you do change it we should issue a warning if you do
t

Tobi

01/11/2019, 9:20 AM
@eskatos I still struggle with updating my project to new version of Kotlin. A recent commit to try this can be found here on the
project-setup
branch: https://github.com/EventFahrplan/EventFahrplan/commit/9cb4c11f0ab8a0737a64b7bc8a78bad3b83004ad If you have some spare time I would appreciate.
e

eskatos

01/11/2019, 9:23 AM
what is the issue you have?
e

eskatos

01/11/2019, 9:35 AM
again, you should not set any version for the
kotlin-dsl
plugin and use the one provided by the current Gradle version you should use the
kotlin-dsl
plugin in your build logic projects only (e.g.
buildSrc
), then in your production code projects you use the regular Kotlin JVM gradle plugin if you do just that and have an issue, please raise it with a reproducer
from our testing, Gradle 4.10.3 works with production projects using Kotlin 1.3
t

Tobi

01/11/2019, 10:00 AM
I just updated the Gradle wrapper from
4.10.2
to
4.10.3
which works. ✔️ As soon as I change
id("org.gradle.kotlin.kotlin-dsl") version "0.18.2"
to
kotlin-dsl
I get the following error:
* What went wrong:
Execution failed for task ':buildSrc:compileKotlin'.
> Could not resolve all files for configuration ':buildSrc:kotlinCompilerPluginClasspath'.
   > Could not find org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.2.61.
     Searched in the following locations: file:~/.gradle/caches/4.10.3/embedded-kotlin-repo-1.2.61-2/repo/org/jetbrains/kotlin/kotlin-scripting-compiler-embeddable/1.2.61/kotlin-scripting-compiler-embeddable-1.2.61.jar
     Required by:
         project :buildSrc
   > Could not find org.jetbrains.kotlin:kotlin-sam-with-receiver:1.2.61.
     Required by:
         project :buildSrc
I then tried to also use Kotlin
1.3.11
instead of
1.2.51
. The error remains the same. I can push these steps as separate commits if this helps.
e

eskatos

01/11/2019, 10:04 AM
do you have a repository declared in buildSrc where those dependencies can be resolved?
t

Tobi

01/11/2019, 10:07 AM
I did not. I defined
mavenCentral()
and resynced the project:
> Configure project :buildSrc
WARNING: Unsupported Kotlin plugin version.
The `embedded-kotlin` and `kotlin-dsl` plugins rely on features of Kotlin `1.2.61` that might work differently than in the requested version `1.3.11`.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':buildSrc'.
> Failed to notify project evaluation listener.
   > java.lang.AbstractMethodError (no error message)
   > java.lang.AbstractMethodError (no error message)
I can paste the
--stacktrace
log if you want it.
e

eskatos

01/11/2019, 10:10 AM
A reproducer project would be much more helpful
t

Tobi

01/11/2019, 10:12 AM
I will push the commits on a branch on my project. Just a second.
👍 1
n

Nikky

01/11/2019, 10:15 AM
seems like you have some dependencies in buildSrc that do not like kotlin 1.3 yet
with kotlin 1.3 i found it sometimes nicer to use gradle 5.0+ the kotlin-dsl plugin will attempt to use the embedded kotlin version from the gradle plugin.. which is old
and dependencies do not line up correctly
t

Tobi

01/11/2019, 10:26 AM
I pushed the steps in separate commits here: https://github.com/EventFahrplan/EventFahrplan/commits/project-setup-2 If you click on the red or the green ✔️ they will take you to the build log of the particular commit. I added the
--stacktrace
option to have a verbose output. With regards to Gradle 5. Last time I checked the Android plugin for Gradle was not ready for Gradle 5.
e

eskatos

01/11/2019, 11:21 AM
thanks, I’ll have a look in a few hours
👍 1
In your root settings.gradle file I see that you
include(":buildSrc")
, you’re not supposed to do that,
buildSrc
is a nested build, not a project. this is probably what messes things
🚀 1
👍🏻 1
t

Tobi

01/11/2019, 11:01 PM
Thank you. You found the source of the errors! Who knows how long it would have taken me. I pushed the commits here: https://github.com/EventFahrplan/EventFahrplan/commits/project-setup-3
👍 1
For anyone to follow up. The temporary branches mentioned here before are now gone. The changes have been merged into
master
. - Thank you once again for your help.