• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Fix dependency errors?

 
Ranch Hand
Posts: 80
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am trying to send http requests:


but I keep getting an errors(it's much longer but here is a snippet):


Any ideas would be great, thanks so much!
 
Greenhorn
Posts: 12
Android Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How you are building your code? The error output tells that there are two different versions of the same jar in the classpath.
 
Glenda Karen
Ranch Hand
Posts: 80
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply!
I was trying to use the rapidapi for http request which needed the following dependencies:

Don't forget to also install the dependencies (org.json, httpclient 4.3.6, httpmime 4.3.6, httpasyncclient 4.0.2) in the classpath too.


So I added the jar files to libs and added as library.
I then decided to try HTTP POST using JSON in Java and that is when I ran into the problem.
I added the dependencies to the build.gradle:


In the code I imported:
 
Roland Mueller
Greenhorn
Posts: 12
Android Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't done any Android coding except some small project, but from the grade.build file the following can be concluded:

Packages httpcore and httpcore-nio seam to be duplicates. At least the versions 4.3.3 and 4.3.2 are the same as in the error message.

According to the information in following site, these libraries are alternatives for blocking and non-blocking I/O.
https://hc.apache.org/httpcomponents-core-4.4.x/index.html




 
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic