Karuna Darekar
Karuna Darekar

Reputation: 359

Program type already present: okhttp3.Authenticator$1

we use kiteconnect.jar file in lib folder for socket connection. Now i m integrating Instamojo payment gateway in application but got this error while run application Program type already present: okhttp3.Authenticator$1 Message{kind=ERROR, text=Program type already present: okhttp3.Authenticator$1, sources=[Unknown source file], tool name=Optional.of(D8)}

after extracting kiteconnect.jar file found the okhttp3 interface in that. now i don't know how to handle this. Please help me out

Upvotes: 3

Views: 2512

Answers (2)

zhen She
zhen She

Reputation: 139

To resolve dependency conflicts, add a configuration.

configurations {

all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'

 }

Upvotes: 0

Thilaw Fabrice
Thilaw Fabrice

Reputation: 742

With Android Studio "3.1.3", It looks like you don't need to explicitly add okhttp3 to your project's gradle anymore. Try to remove all okhttp3 lines from your build.gradle. Then sync your project to see if everything works fine.

implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.0.0'

It works for me. Here is my Android Studio version details :
Android Studio 3.1.3
Build #AI-173.4819257, built on June 4, 2018
JRE: 1.8.0_152-release-1024-b02 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

Upvotes: -1

Related Questions