1

I am building a weather forecast app using API from this(openweathermap.org) website. For this I have used two dependencies such as

1.('com.appunity.retrofit2:converter-gson:2.0.2')

2.('com.squareup.retrofit:retrofit:2.0.0-beta2').

And I got this type of error that I have given below.

Duplicate class retrofit2.http.Path found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)

Duplicate class retrofit2.http.Query found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)

Duplicate class retrofit2.http.QueryMap found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)

Duplicate class retrofit2.http.Streaming found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)

Duplicate class retrofit2.http.Url found in modules jetified-retrofit-2.0.2.jar (com.appunity.retrofit2:retrofit:2.0.2) and jetified-retrofit-2.5.0.jar (com.squareup.retrofit2:retrofit:2.5.0)

Go to the documentation to learn how to Fix dependency resolution errors.
Aman Srivastava
  • 1,007
  • 1
  • 13
  • 25
  • The latest version of Retrofit and convertor-gson is `2.9.0`. Is there any specific reason to use the `2.0.0-beta2` version? Update it to latest version and check – Shashanth Jun 01 '20 at 16:08
  • And also, the converter-gson package is `com.squareup.retrofit2` not `com.appunity.retrofit2` – Shashanth Jun 01 '20 at 16:10
  • I have followed your instructions abd add those libraries then got the new error messsage. and this error message is "CIRCULAR REFERENCE:com.android.tools.r8.a: Invoke-customs are only supported starting with Android O (--min-api 26)" – Sujit Kumar Sarkar Jun 02 '20 at 12:02
  • Check this StackOverflow [answer](https://stackoverflow.com/q/49891730/5180017) – Shashanth Jun 02 '20 at 17:06

0 Answers0