Evgenyt
Evgenyt

Reputation: 10731

Android: On some devices I get NoSuchMethodError when calling method of linked library

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?

Upvotes: 0

Views: 965

Answers (2)

DKIT
DKIT

Reputation: 3481

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. :-)

Upvotes: 0

kosa
kosa

Reputation: 66657

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.

Upvotes: 1

Related Questions