question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrade Okio to 2.x

See original GitHub issue

We are writing an a Kotlin app that uses Lottie and OkHTTP. We are considering replacing Lottie due to the project’s reliance on Okio 1.x. This causes a circular dependency that is caught by Gradle when using OkHTTP 4.x and Lottie in the same project. I see that about a year ago the project added a comment // Do not ugprade to 2.0 because it will bring in Kotlin as a transitive dependency. to the project’s build.gradle. Has anything changed?

Steps to reproduce the behavior:

  1. Clone https://github.com/mozilla-mobile/fenix
  2. Change the mockwebserver value to a current 4.x release. ex: 4.5.0
  3. Compile debug app
  4. Circular dependency error from the compiler. OkHTTP wants Okio 2.x and Lottie wants Okio 1.x

https://github.com/mozilla-mobile/fenix/issues/8169#issuecomment-600231224

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
kbrosnancommented, May 27, 2020

Looking at okio’s 2.0.0-rc1 release notes page they have the following notes about migrating from 1.x to 2.x

Okio 2 is a major release that upgrades the library’s implementation language from Java to Kotlin.

Okio 2.x is binary-compatible with Okio 1.x and does not change any behavior. Classes and .jar files compiled against 1.x can be used with 2.x without recompiling.

Okio 2.x is .java source compatible with Okio 1.x in all but one corner case. In Okio 1.x Buffer would throw an unchecked IllegalStateException when attempting to read more bytes than available. Okio 2.x now throws a checked EOFException in this case. This is now consistent with the behavior of its BufferedSource interface. Java callers that don’t already catch IOException will now need to.

Okio 2.x is .kt source-incompatible with Okio 1.x. This release adopts Kotlin idioms where they are available. [omitted list of idioms, see link to full release notes]

0reactions
mstangecommented, Oct 13, 2020

Doesn’t the circular dependency issue still exist?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change Log - Okio
Most users should be able to upgrade from 2.x by just changing the version. If you're using Okio in a Kotlin Multiplatform project,...
Read more >
Migration guides - Apollo GraphQL Docs
Migrating to 2.x ... Okio has been updated to 2.4.3 for Kotlin multiplatform. ... Note: while we initially considered upgrading Okhttp to version...
Read more >
How to Update Your OKIOCAM T! (Windows) - Okiolabs
Click on the X in the top-right corner to close the OKIOCAM T Firmware Update app. We hope you all enjoy the new...
Read more >
Migrate to v10 | Maps SDK | Android - Mapbox docs
Upgrading to use OkHttp / Okio 4.+. The Mapbox Maps SDK v10 is using OkHttp v4.9.0 by default under the hood. It is...
Read more >
gnastnosaj / okhttp Download - JitPack
... dependency on Okio, a small library for high-performance I/O. It works with either Okio 1.x (implemented in Java) or Okio 2.x (upgraded...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found