0

I am getting java.lang.VerifyError in call Webservice communicator class.

This Error is seen only in Android 4.2 O.S devices. And its working well on all other devices of OS and Tabs too.

below are my logs:

01-09 06:15:10.263: E/AndroidRuntime(785): FATAL EXCEPTION: Thread-78
01-09 06:15:10.263: E/AndroidRuntime(785): java.lang.VerifyError: org/ksoap2/SoapEnvelope
01-09 06:15:10.263: E/AndroidRuntime(785):  at com.weg.ecatalogue.servercommunication.WebServiceCommunicator$2.run(WebServiceCommunicator.java:78)
01-09 06:15:10.263: E/AndroidRuntime(785):  at java.lang.Thread.run(Thread.java:856)

Please suggest me, about this 4.2 OS dependent issue.

Sam-In-TechValens
  • 2,501
  • 4
  • 34
  • 67

2 Answers2

7

Use this jar file for call soap webservices

ksoap2-android-assembly-2.6.2-jar-with-dependencies .jar

And replace AndroidHttpTransport class to HttpTransportSE

xlecoustillier
  • 16,183
  • 14
  • 60
  • 85
hharry
  • 422
  • 1
  • 9
  • 21
0

The problem was on ksoap2-android-2.5.2.jar file. Earlier we pasted that file on lib folder,right click and selected set as a library from the menu. That worked fine with an emulator but crashed when using real devices. Then we deleted the jar file from the lib folder and added these to Gradle.

Solution : add this snippet into buildTypes

repositories {
    maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }

add this snippet into dependencies

implementation 'com.google.code.ksoap2-android:ksoap2-android:3.6.1'

and also remove jar file from libs

Zoe
  • 27,060
  • 21
  • 118
  • 148