'Implementation OKHTTP doesn't work on Android project

i followed this tutorial: https://www.journaldev.com/13629/okhttp-android-example-tutorial But when i try to start the project give me this error:

Execution failed for task ':app:checkDebugAarMetadata'.
 Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.squareup.okhttp3:okhttps:3.4.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/squareup/okhttp3/okhttps/3.4.1/okhttps-3.4.1.pom
       - https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttps/3.4.1/okhttps-3.4.1.pom
       - https://jcenter.bintray.com/com/squareup/okhttp3/okhttps/3.4.1/okhttps-3.4.1.pom
     Required by:
         project :app

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

And exactly when i try to write the implementation 'com.squareup.okhttp3:okhttps:3.4.1'



Solution 1:[1]

Use this in your build.gredle file

 dependencies {    
        //Retrofit
        implementation 'com.squareup.retrofit2:retrofit:2.9.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
        implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
        implementation 'com.squareup.okhttp3:okhttp:4.9.0'
        implementation 'com.squareup.okhttp3:okhttp-urlconnection:4.4.1'
    }

This may Help someone

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1