问题
I've added external library (ksoap2) to my Android project.
On most devices it works ok (Android 2.3). But on others (also Android 2.3) I get
java.lang.NoSuchMethodError: org.ksoap2.serialization.SoapObject.getPropertyAsString
What can be the reason of such error?
回答1:
1) There might be mulitple jars (native libraries) with same code, which may cause wrong class get loaded.
2) Incompatable version of jar, the jar you have in classpath might be older version/newer version.
I strongly suspect in your case it is first. I guess you have two versions of native libraries on the devices where it is failing.
回答2:
It may be that the device's implementation of Java does not contain the jars the ksoap library is dependent on. Remember that Android devices does not support full Java SE, although it supports most of it.
Edit: Oops, I just realized the 'no such method error' was in the Soap package, so my explanation does not hold water. :-)
来源:https://stackoverflow.com/questions/9231654/android-on-some-devices-i-get-nosuchmethoderror-when-calling-method-of-linked-l