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
c

coroutinedispatcher

12/26/2021, 1:39 PM
Hello. I was unsure whether to create an issue in ktor, since I am not sure if I am doing something wrong, or it is an actual bug. Basically, I am unable to import dependencies in a project. Steps to reproduce: 1 - Go to start.ktor.io 2 - Generate a new project 3 - Open from IntelliJ 4 - go to the single `build.gradle`file and try to import:
implementation("org.kodein.di:kodein-di-generic-jvm:6.3.4")
implementation("org.kodein.di:kodein-di-framework-ktor-server-jvm:6.3.4")
🔴 It will fail with this error message:
Execution failed for task ':compileKotlin'.
> Error while evaluating property 'filteredArgumentsMap' of task ':compileKotlin'
   > Could not resolve all files for configuration ':compileClasspath'.
      > Could not find org.kodein.di:kodein-di-generic-jvm:6.3.4.
        Searched in the following locations:
          - <https://repo.maven.apache.org/maven2/org/kodein/di/kodein-di-generic-jvm/6.3.4/kodein-di-generic-jvm-6.3.4.pom>
          - <https://maven.pkg.jetbrains.space/public/p/ktor/eap/org/kodein/di/kodein-di-generic-jvm/6.3.4/kodein-di-generic-jvm-6.3.4.pom>
        Required by:
            project :
      > Could not find org.kodein.di:kodein-di-framework-ktor-server-jvm:6.3.4.
        Searched in the following locations:
          - <https://repo.maven.apache.org/maven2/org/kodein/di/kodein-di-framework-ktor-server-jvm/6.3.4/kodein-di-framework-ktor-server-jvm-6.3.4.pom>
          - <https://maven.pkg.jetbrains.space/public/p/ktor/eap/org/kodein/di/kodein-di-framework-ktor-server-jvm/6.3.4/kodein-di-framework-ktor-server-jvm-6.3.4.pom>
        Required by:
            project :

Possible solution:
 - Declare repository providing the artifact, see the documentation at <https://docs.gradle.org/current/userguide/declaring_repositories.html>
However, it’s not the issue of the library I tried, even if you import other libraries except jetbrain libraries, it would also happen. What am I doing wrong here? Setup is pretty straightforward actually, nothing new added:
val ktor_version: String by project
val kotlin_version: String by project
val logback_version: String by project
val exposedVersion: String by project

plugins {
    application
    kotlin("jvm") version "1.6.10"
    id("org.jetbrains.kotlin.plugin.serialization") version "1.6.10"
}

group = "com.coroutinedispatcher"
version = "0.0.1"
application {
    mainClass.set("com.coroutinedispatcher.ApplicationKt")
}

repositories {
    mavenCentral()
    maven { url = uri("<https://maven.pkg.jetbrains.space/public/p/ktor/eap>") }
}

dependencies {
    implementation("io.ktor:ktor-server-content-negotiation:$ktor_version")
    implementation("io.ktor:ktor-server-core:$ktor_version")
    implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version")
    implementation("io.ktor:ktor-server-auth:$ktor_version")
    implementation("io.ktor:ktor-server-netty:$ktor_version")
    implementation("ch.qos.logback:logback-classic:$logback_version")
    implementation("org.jetbrains.exposed:exposed-core:$exposedVersion")
    implementation("org.jetbrains.exposed:exposed-dao:$exposedVersion")
    implementation("org.jetbrains.exposed:exposed-jdbc:$exposedVersion")
    implementation("mysql:mysql-connector-java:8.0.19")
    implementation("org.kodein.di:kodein-di-generic-jvm:6.3.4")
    implementation("org.kodein.di:kodein-di-framework-ktor-server-jvm:6.3.4")
    testImplementation("io.ktor:ktor-server-tests:$ktor_version")
    testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version")
}
b

Big Chungus

12/26/2021, 2:16 PM
Try dropping -jvm suffix from the dependency and let gradle metadata figure out the right artefact flavour
Also make sure you're using JDK 8+ (preferably JDK 11+) and gradle 6+
AH, I know what's up! There's simply no such kodein version
a

Alexandre Brown

12/26/2021, 2:46 PM
You should try the latest version (7.10.0) org.kodein.di:kodein-di-framework-ktor-server-jvm:7.10.0
c

coroutinedispatcher

12/26/2021, 2:57 PM
nope, neither dropping JVM nor updating the version didn’t work 🤔
b

Big Chungus

12/26/2021, 3:03 PM
which version did you bump it to and what errors are you getting?
c

coroutinedispatcher

12/26/2021, 3:03 PM
it seems like only this
org.kodein.di:kodein-di-generic-jvm:7.3.1
is the one that it cannot be found
b

Big Chungus

12/26/2021, 3:13 PM
Latest is 7.10.0
That's only true for
kodein-di-framework-ktor-server-jvm
,
kodein-di-generic-jvm
seems to have stopped at
6.5.5
c

coroutinedispatcher

12/26/2021, 3:14 PM
yes but not for
kodein-di-generic-jvm
let me try 6.5.5
b

Big Chungus

12/26/2021, 3:15 PM
c

coroutinedispatcher

12/26/2021, 3:15 PM
damn
b

Big Chungus

12/26/2021, 3:15 PM
you need
org.kodein.di:kodein-di:7.10.0
instead
(generic by default)
c

coroutinedispatcher

12/26/2021, 3:15 PM
let me check
this seems to work, but I remember a completely different API 🙈
anyways, thanks
b

Big Chungus

12/26/2021, 3:22 PM
APIs change with time 😄 Back to brushing up on the docs for you!
c

coroutinedispatcher

12/26/2021, 3:23 PM
yea yea, I meant that it has been a lot since I haven’t used kodein, of course that the API would have changed. However, googling: “kodein ktor” you will see the first result, which is the old one (also old design).
b

Big Chungus

12/26/2021, 3:24 PM
Don't google then. Official docs are great https://docs.kodein.org/kodein-di/7.10/framework/ktor.html
c

coroutinedispatcher

12/26/2021, 3:24 PM
thanks