问题描述
我试图用JSoup 1.6.0与我的Android应用程序,它抛出一个异常NoSuchMethodExists
I'm trying to use JSoup 1.6.0 with my Android application and it throws a NoSuchMethodExists exception.
告诉我的isEmpty()没有加入的Java JRE直到1.6 - 我检查了我的日食JRE,它是1.6,但是当我尝试在我的模拟器中运行我的应用程序,它抛出上述异常。是否有一个解决方法,或者我应该只需要导入了Apache下议院Lang库?
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()
不可用,直到API级别9.相反,你可以使用 TextUtils.isEmpty()
。
String.isEmpty()
isn't available until API level 9. Instead, you can use TextUtils.isEmpty()
.
它看起来像JSoup 1.6引入了code,使用 String.isEmpty()
,因此将需要Android的API级别9.我会建议使用的旧版本JSoup现在,如果你是针对Android的API 8级以下(升级Froyo)。
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).
这被视为JSoup 1.6.0中的错误,你很快就可以期待一个修补程序。请参见了解情况。
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.
这篇关于JSoup 1.6.0在Android抛出异常:String.isEmpty()NoSuchMethodExists的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!