JSoup 1.6.0 on Android throws an exception: String.isEmpty () NoSuchMethodExists

I am trying to use JSoup 1.6.0 with my Android application and it throws a NoSuchMethodExists exception.

This other question tells me that isEmpty () was not added to the Java JRE until 1.6 - I checked my JRE in eclipse and it is 1.6, however, when I try to run my application on my emulator, it throws an exception above. Is there a fix, or should I just import the Apache Commons Lang library?

+4
source share
1 answer

String.isEmpty() not available until API level 9. Instead, you can use TextUtils.isEmpty() .

It seems that JSoup 1.6 introduced code that uses String.isEmpty() , and therefore, you will need the Android API level 9. I would suggest using an earlier version of JSoup if you configure Android API 8 or lower (Froyo).

This is seen as a bug in JSoup 1.6.0, and you can expect a fix in the near future. See https://github.com/jhy/jsoup/issues/103 for status.

+9
source

All Articles