Home > front end >  Unable to import Okhttp tls to kotlin project
Unable to import Okhttp tls to kotlin project

Time:10-29

I am trying to import OkHttp TLS to be able to use certificates and other OkHttp TLS functionality

my build.gradle.kts looks like this

implementation ("com.squareup.okhttp3:okhttp-tls")

However, gradle is unable to find this module

Could not find com.squareup.okhttp3:okhttp-tls

Unsure if okhttp tls is not imported this way any longer

CodePudding user response:

Maybe you want to try the following

implementation("com.squareup.okhttp3:okhttp:4.10.0")

You can take a closer look at the docs

dependencies {
   // define a BOM and its version
   implementation(platform("com.squareup.okhttp3:okhttp-bom:4.10.0"))

   // define any required OkHttp artifacts without version
   implementation("com.squareup.okhttp3:okhttp")
   implementation("com.squareup.okhttp3:logging-interceptor")
}
  • Related