grpc / grpc-java

The Java gRPC implementation. HTTP/2 based RPC
https://grpc.io/docs/languages/java/
Apache License 2.0
11.36k stars 3.82k forks source link

Upgrade runtime dependency on OKIO to 2.0.0 #10455

Closed wu-hui closed 1 year ago

wu-hui commented 1 year ago

https://github.com/firebase/firebase-android-sdk/issues/5197 is reported to Firebase-Firestore because it does not work with mlkit:

com.squareup.okio:okio:2.0.0
\--- com.google.mlkit:digital-ink-recognition:18.1.0
     \--- releaseRuntimeClasspath

com.squareup.okio:okio:1.15.0 -> 2.0.0
\--- com.squareup.okhttp3:okhttp:3.12.1
     \--- com.google.mlkit:digital-ink-recognition:18.1.0
          \--- releaseRuntimeClasspath

com.squareup.okio:okio:1.17.5 -> 2.0.0
+--- releaseRuntimeClasspath
\--- io.grpc:grpc-okhttp:1.52.1
     \--- com.google.firebase:firebase-firestore:24.7.0
          +--- com.google.firebase:firebase-bom:32.2.0
          |    \--- releaseRuntimeClasspath
          \--- com.google.firebase:firebase-firestore-ktx:24.7.0
               +--- releaseRuntimeClasspath (requested com.google.firebase:firebase-firestore-ktx)
               \--- com.google.firebase:firebase-bom:32.2.0 (*)

Can we consider upgrading the grpc dependency of okio to 2.0.0 so mlkit and firestore can co-exist?

ejona86 commented 1 year ago

We've already upgraded okio to 2.10.0 in #10359. I wasn't aware there was an ABI issue with okio 2.x, otherwise we would have upgraded much sooner. I had tested forever ago and there was no API issue.

The change will be part of 1.58, scheduled for Sept 5th.

ejona86 commented 1 year ago

Actually, I don't see any ABI issue here. You might try a later version of okio than 2.0. I just checked okio 2.10.0 and it has the method the error claimed didn't exist:

$ javap BufferedSource.class | grep getBuffer
  public abstract okio.Buffer getBuffer();

That is "getBuffer()Lokio/Buffer; in class Lokio/BufferedSource;"