Win a copy of Pipeline as Code this week in the Cloud/Virtualization forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Fix dependency errors?

 
Ranch Hand
Posts: 89
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: 89
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




 
Destiny's powerful hand has made the bed of my future. And this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic