conekta / conekta-android

12 stars 12 forks source link

ClassNotFoundException: Didn't find class "org.apache.http.message.BasicNameValuePair" #22

Closed JINC06 closed 5 years ago

JINC06 commented 5 years ago

I had a problem using the conekta library on Android 9.

java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/message/BasicNameValuePair; at io.conekta.conektasdk.Token.create(Token.java:41) at com.caffenio.app.fragments.payment.SummaryPaymentFragment.tokenizeCard(SummaryPaymentFragment.java:577) at com.caffenio.app.fragments.payment.SummaryPaymentFragment.lambda$onViewCreated$1(SummaryPaymentFragment.java:166)

Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.message.BasicNameValuePair" on path: DexPathList[[zip file "/data/app/

I fix the problem adding the next lines on android manifest

android:usesCleartextTraffic="true" on application

and inside <uses-library android:name="org.apache.http.legacy" android:required="false" />

https://imgur.com/hbtwrIA

I hope someone who has the same problem could fix it

Best regards

AdamPreneur commented 3 years ago

Thanks @JINC06 You just saved my day.