Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

httpclient java issue in Android Studio #127

Closed
ivanchaukn opened this issue Aug 3, 2016 · 11 comments
Closed

httpclient java issue in Android Studio #127

ivanchaukn opened this issue Aug 3, 2016 · 11 comments
Labels
status: duplicate duplicate issue status: help wanted requesting help from the community type: bug bug in the library

Comments

@ivanchaukn
Copy link

Issue Summary

When initialize sendgrid in android studio, I got the error below
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.impl.client.HttpClients"

My guess is API 23 or above do not support httpclient anymore which the sendgrid java is still using. Can you please investigate and fix accordingly? Much appreciated!

http://stackoverflow.com/questions/32153318/httpclient-wont-import-in-android-studio

Steps to Reproduce

  1. Send an email in android studio using API 24 and Sendgrid java library

Technical details:

  • sendgrid-java Version: master
  • Java Version: 8
@thinkingserious thinkingserious changed the title httpclient java issue httpclient java issue in Android Studio Aug 4, 2016
@thinkingserious thinkingserious added type: bug bug in the library status: help wanted requesting help from the community labels Aug 4, 2016
@thinkingserious
Copy link
Contributor

Thanks @ivanchaukn,

As a short term fix, have you tried adding the HttpClient jar directly into your project?

@thinkingserious thinkingserious added the status: duplicate duplicate issue label Aug 4, 2016
@thinkingserious
Copy link
Contributor

@ivanchaukn,

To track the long term fix, please follow this thread.

For the short term, I've added a section to our TROUBLESHOOTING section.

Thanks!

@ivanchaukn
Copy link
Author

Adding the useLibrary 'org.apache.http.legacy' to gradle does not work. Some modules (CloseableHttpResponse, HttpPatch) probably does not exist in the apache legacy library.

@thinkingserious
Copy link
Contributor

@ivanchaukn,

Thanks for trying that and following up, could you please also try adding the .jar files directly? You can find them here: https://github.com/sendgrid/java-http-client/tree/master/examples

@ivanchaukn
Copy link
Author

Sorry, I can't import the jar files independently since the sendgrid library already contain those dependencies. Do you have another workable short-term fix I can use? What is the ETA for the permanent fix?

@thinkingserious
Copy link
Contributor

@ivanchaukn,

Thanks for the update!

This ticket (sendgrid/java-http-client#2) is not very high on our backlog queue at the moment and I really don't have a good guess on the ETA, except that it would probably be months away.

The only way it will bump up on the queue is:

  1. More +1 or comments on the issue
  2. Someone submits a pull request with a signed CLA

With Best Regards,

Elmer

@valokafor
Copy link

valokafor commented Oct 8, 2016

@thinkingserious thanks you so much for the work you have put out. I have consumed a lot of your material this past two days to accomplish what I thought was a simple use case which is to post a Webhook to Azure Function endpoint from Android. I am close until I hit the wall with httpclient issue in Android.

I have tried adding the .jar files directly however that did not fix the issue. And all I wanted to was to do was pass a unique argument which for some reason that gets dropped when I use this library https://github.com/danysantiago/sendgrid-android.

I know your team is busy, however, I am stalled on this issue. I will continue to explore workaround for now,

@thinkingserious
Copy link
Contributor

Hello @valokafor,

Thanks for reaching out to us!

That library is not an official SendGrid library. I suggest you open up an issue at that project.

With Best Regards,

Elmer

@valokafor
Copy link

Thanks, I know its not an official SendGrid library, and my question is regarding how your official Java library, this one will support Android. Because currently I am getting Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.impl.client.HttpClients" with this library.

@valokafor
Copy link

I have tried to add the jar files directly with no success, any help will be greatly appreciated.

@thinkingserious
Copy link
Contributor

thinkingserious commented Oct 10, 2016

Ah, thanks for the clarification @valokafor.

You will want to track this issue for a fix: sendgrid/java-http-client#2

BTW, I added your vote to the issue to help it rise faster in our queue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate duplicate issue status: help wanted requesting help from the community type: bug bug in the library
Projects
None yet
Development

No branches or pull requests

3 participants