문제

I'm 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 Java JRE until 1.6 -- I've checked my JRE in eclipse, and it is 1.6, however when I try to run my app on my emulator it throws the above exception. Is there a fix, or should I just import the Apache Commons Lang library?

도움이 되었습니까?

해결책

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

It looks like JSoup 1.6 introduced code that uses String.isEmpty() and therefore will require Android API level 9. I would suggest using an older release of JSoup for now if you are targeting Android API level 8 or lower (Froyo).

This is being treated as a bug in JSoup 1.6.0 and you can expect a fix soon. See https://github.com/jhy/jsoup/issues/103 for status.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top