twilio / twilio-java

A Java library for communicating with the Twilio REST API and generating TwiML.
MIT License
490 stars 429 forks source link

java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; #463

Closed khushboojain942 closed 5 years ago

khushboojain942 commented 5 years ago

Hello sir , When i impalement twilio sdk implementation group: 'com.twilio.sdk', name: 'twilio', version: '7.17.0'

for vocie call

try { Call call = Call.creator( new PhoneNumber("+xxxxxxxxxxx"), // To number new PhoneNumber("+xxxxxxxxxxx"), // From number // Read TwiML at this URL when a call connects (hold music) new URI("http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient") ).create(); System.out.println(call.getSid()); } catch (URISyntaxException e) { e.printStackTrace(); }

implement successfully but getting run time Apache issue i also try to import Apache httpclient and httpcore but getting same error every time

java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; or its superclasses (declaration of 'org.apache.http.conn.ssl.AllowAllHostnameVerifier' appears in /system/framework/ext.jar)

Please help me if i m missing something in implementation

childish-sambino commented 5 years ago

The version you're referencing is fairly old and is no longer actively supported. Could you try using the latest version of this lib?

khushboojain942 commented 5 years ago

Sir actually my application concept Is based on voice and video features, but when i used this with two library then gradle is return duplicate library issue error that's why i am trying this common library but this library also return this Apache issue

implementation 'com.twilio:video-android:4.2.0' implementation 'com.twilio:voice-android:3.1.0'

Error: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes. Program type already present: org.webrtc.ContextUtils

And when I exclude this then showing another duplicate_classes

Please suggest me any suggestion to use both features together in application

childish-sambino commented 5 years ago

Ah, the client-side, Android libs are maintained elsewhere (this is the server-side library). Suggest posting an issues over there: https://github.com/twilio/voice-quickstart-android/issues

khushboojain942 commented 5 years ago

Ok thanks u so much sir for responding

khyatiChitroda commented 5 years ago

Hello sir,

I had implemented "com.twilio.sdk:twilio:7.41.1", I am getting same error.

I want to use what's app api.

IstiyakV commented 5 years ago

i also have the same problem while developing app for whats app sms sending in android sdk version 23

childish-sambino commented 5 years ago

@khushboojain942 @IstiyakV Client-side SDKs are separate from this repo (this is the server-side library). These are better references for the chat SDK:

ArjunBhilare commented 3 years ago

Hello sir,

I had implemented "com.twilio.sdk:twilio:7.41.1", I am getting same error.

I want to use what's app api.

Have you found solution to it?

ArjunBhilare commented 3 years ago

i also have the same problem while developing app for whats app sms sending in android sdk version 23

Have you resolved this problem?

ArjunBhilare commented 3 years ago

Hello sir , When i impalement twilio sdk implementation group: 'com.twilio.sdk', name: 'twilio', version: '7.17.0'

for vocie call

try { Call call = Call.creator( new PhoneNumber("+xxxxxxxxxxx"), // To number new PhoneNumber("+xxxxxxxxxxx"), // From number // Read TwiML at this URL when a call connects (hold music) new URI("http://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient") ).create(); System.out.println(call.getSid()); } catch (URISyntaxException e) { e.printStackTrace(); }

implement successfully but getting run time Apache issue i also try to import Apache httpclient and httpcore but getting same error every time

java.lang.NoSuchFieldError: No static field INSTANCE of type Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; in class Lorg/apache/http/conn/ssl/AllowAllHostnameVerifier; or its superclasses (declaration of 'org.apache.http.conn.ssl.AllowAllHostnameVerifier' appears in /system/framework/ext.jar)

Please help me if i m missing something in implementation

@khushboojain942 how did you resolve this error??