Search code examples
androidapismstwiliomms

java.lang.NoSuchMethodError: org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager


i integrated twilio api for my android application,but i got below error for whenever run my android application.

java.lang.NoSuchMethodError: org.apache.http.impl.conn.tsccm.ThreadSafeClientConnMana ger

i was added my build path below jars.

  1. commons.httpclient-3.1.jar

  2. twilioclient-android-1.1.2.jar

  3. twilio-java-sdk-3.3.14.jar

4 .httpClient-4.12.jar

Thanks


Solution

  • The existing Twilio client library for Java unfortunately will not do the job for you here - the HTTP client it uses under the covers (commons HTTP client) does not work on Android.

    Also, I should point out that you probably do not want to hit the Twilio REST API directly from an Android application that will be installed on an end user's phone or tablet. Your Twilio account credentials would be embedded in the resulting code, and could be extracted by a malicious party.

    If you want to make use of the Twilio REST API from an Android app, your best bet is to do so through a server-based proxy. The server-side code could use Twilio to send messages or make calls while protecting your Twilio API credentials.