Neal Sanche
03/22/2021, 10:01 PMdownloadApolloSchema
gradle target, and wasn't able to. I've configured my multiplatform project exactly as the documentation says. But where this project differs is in the top level build gradle file which has:
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.31")
classpath("com.android.tools.build:gradle:7.0.0-alpha11")
I found that if I use android tools > 7.0.0-alpha06
I get the following error when downloading a schema through gradle:
* What went wrong:
Execution failed for task ':shared:downloadApolloSchema'.
> Companion
If I --stacktrace
that, a bit more information is present:
Caused by: java.lang.NoClassDefFoundError: Could not initialize class okhttp3.internal.Util
at okhttp3.RequestBody$Companion.create(RequestBody.kt:145)
at okhttp3.RequestBody$Companion.create$default(RequestBody.kt:143)
at com.apollographql.apollo.gradle.internal.SchemaHelper.executeQuery$apollo_gradle_plugin(SchemaHelper.kt:39)
Which doesn't make a lot of sense. Why would things change in 7.0.0-alpha07
that would cause this sort of issue? Any ideas?wasyl
03/22/2021, 10:09 PM./gradlew buildEnvironment
. Perhaps AGP 7 is pulling some incompatible version of okhttp, anyway seems like some mismatch between expected and provided OkHttp classeswasyl
03/22/2021, 10:10 PMwasyl
03/22/2021, 10:10 PMclasspath()
configuration, see if it helps 🤔Neal Sanche
03/22/2021, 10:14 PMNeal Sanche
03/22/2021, 10:17 PMclasspath 'com.squareup.okhttp3:okhttp:4.9.1'
made the build succeed, and I was also able to generate the apollo client code too. Thanks @wasylwasyl
03/22/2021, 10:25 PMmbonnin
03/22/2021, 11:00 PMbuildSrc
, but also in other cases Gradle doesn't do dependency resolution and puts an "older" version of dependencies in the classpathmbonnin
03/22/2021, 11:01 PMwasyl
03/22/2021, 11:01 PMmbonnin
03/22/2021, 11:02 PMwasyl
03/22/2021, 11:03 PMNeal Sanche
03/23/2021, 5:26 PM| +--- io.grpc:grpc-all:1.21.1
| | +--- io.grpc:grpc-api:1.21.1 (*)
| | +--- io.grpc:grpc-auth:1.21.1
| | | +--- io.grpc:grpc-api:1.21.1 (*)
| | | \--- com.google.auth:google-auth-library-credentials:0.13.0
| | +--- io.grpc:grpc-core:1.21.1 (*)
| | +--- io.grpc:grpc-context:1.21.1
| | +--- io.grpc:grpc-netty:1.21.1 (*)
| | +--- io.grpc:grpc-okhttp:1.21.1
| | | +--- io.grpc:grpc-core:1.21.1 (*)
| | | +--- com.squareup.okhttp:okhttp:2.5.0
| | | | \--- com.squareup.okio:okio:1.6.0 -> 2.8.0
Which explains the issue. I can also clearly see that this dependency was introduced AGP alpha07, I wonder if there's any documentation on why this change was introduced?mbonnin
03/23/2021, 5:29 PMNeal Sanche
03/23/2021, 5:29 PMmbonnin
03/23/2021, 5:29 PMgrpc
looks interesting for a build toolwasyl
03/23/2021, 5:36 PMmbonnin
03/23/2021, 5:37 PMmbonnin
03/23/2021, 5:37 PMwasyl
03/23/2021, 5:40 PMwasyl
03/23/2021, 5:41 PMmbonnin
03/23/2021, 5:41 PMwasyl
03/23/2021, 6:01 PMmbonnin
03/23/2021, 6:02 PMmbonnin
03/23/2021, 6:03 PMwasyl
03/23/2021, 6:05 PMmbonnin
03/23/2021, 6:05 PMNeal Sanche
03/23/2021, 7:13 PMwasyl
03/23/2021, 7:19 PMNeal Sanche
03/23/2021, 8:27 PMmbonnin
03/23/2021, 8:33 PMNeal Sanche
03/23/2021, 8:33 PMmbonnin
03/23/2021, 8:34 PMmbonnin
03/23/2021, 8:34 PMNeal Sanche
03/23/2021, 8:38 PM