google-places-api-java icon indicating copy to clipboard operation
google-places-api-java copied to clipboard

Trouble compiling the project using Gradle

Open jidesoft opened this issue 7 years ago • 0 comments

In order to use this project in an Android app, I had these two lines in the gradle script.

    implementation 'se.walkercrou:google-places-api-java:2.1.7'
    implementation 'org.apache.httpcomponents:httpclient-android:4.3.5.1'

I noticed the following libraries were added because of the two lines above.

Gradle: org.apache.httpcomponents:httpclient:4.3.5@jar
Gradle: org.apache.httpcomponents:httpclient-android:4.3.5.1@jar
Gradle: org.apache.httpcomponents:httpcore:4.3.2@jar

When I compile and run the project, I got this error message.

Program type already present: org.apache.http.ContentTooLongException

The reason is ContentTooLongException class is present in both httpcore 4.3.2 jar and the httpclient-android 4.3.5.1 jar. If you remove httpclient-android, it compiles but ends up with a run-time exception at the BasicLineFormatter. Do you guys have any idea how to solve this issue?

Thank you!

jidesoft avatar May 05 '18 05:05 jidesoft