https://kotlinlang.org logo
#apollo-kotlin
Title
# apollo-kotlin
c

Colton Idle

02/07/2023, 12:35 AM
first time working with apollo kotlin. trying to add apollo-kotlin to a new module i created. when i sync i get this error. Am I missing something fundamental here? Edit: fairly certain something is either wrong with apollo-kotlin or maven central?
e

ephemient

02/07/2023, 1:13 AM
Copy code
repositories {
    mavenCentral()
}
?
hmm, although I'm not sure how you'd get
apollo-runtime
without central
c

Colton Idle

02/07/2023, 1:25 AM
yeah my root build.gradle.kts has this
whats interesting is the error message says
:apollo-lib:test:
but the name of my module is apollo-lib
and theres no test directory or anything
actually. its two error messages. the second one is identical except its
:apollo-lib:main:
seems like it happens in a brand new project as well. hm. anyone think that maybe mavenCentral is down or something?
e

ephemient

02/07/2023, 3:05 AM
hmm. 3.9.3 doesn't seem to exist on central, plenty of earlier and later versions though
c

Colton Idle

02/07/2023, 3:08 AM
Weird. I tried
Copy code
configurations.all {
  resolutionStrategy {
    force("com.squareup.okhttp3:okhttp:4.10.0")
  }
}
and that didn't work either
does look like 4.9.3 is on mavencentral for okhttp https://search.maven.org/artifact/com.squareup.okhttp3/okhttp/4.9.3/jar
e

ephemient

02/07/2023, 3:53 AM
oh I see it listed on https://search.maven.org/artifact/com.squareup.okhttp3/okhttp, it wasn't showing up for me earlier. strange.
c

Colton Idle

02/07/2023, 3:58 AM
any ideas on what i can do to debug? this is killin me. tried it in two projects + a greenfield project. still no dice.
can't be just me... can it?
b

bod

02/07/2023, 8:22 AM
👀 Odd! Let me see if I can repro.
nope, can't repro (on this most basic project)
gradle didn't let me use
sourceCompatibility = JavaVersion.VERSION_1_7
though, I wonder if it could be related
maybe more logs could enlighten us 🙂 (
./gradlew -i --stacktrace assemble
)
c

Colton Idle

02/07/2023, 12:37 PM
Updated from 1_7 to 11 and everything seems to work now?
🤯
im not even on latest agp alpha or anything that forces java 11. but i guess that was the culprit
b

bod

02/07/2023, 12:39 PM
Thanks for reporting back!
c

Colton Idle

02/07/2023, 12:39 PM
Going back down to 1_7 repros the issue. 1_8 and 11 work.
¯\_(ツ)_/¯
thank you all. i was going to miss my deadlines because of this lol
b

bod

02/07/2023, 12:40 PM
Haha well thanks for reaching out!
e

ephemient

02/07/2023, 12:44 PM
1.7 was not a particularly useful target anyway: Kotlin skipped from generating 1.6 bytecode to 1.8, and there's pretty much no reason to have a lower target now
I guess Gradle was like "there's no okhttp artifacts available to this project because they require 1.8+, but I'm not gonna tell you that directly"
c

Colton Idle

02/07/2023, 2:50 PM
yeah. maybe worth calling out in the docs
¯\_(ツ)_/¯
10 Views