I am getting following Exception on Android 2.2.1:
java.lang.NoSuchMethodError: java.lang.String.isEmpty
I am calling text.isEmpty
from Scala. Any idea, how to solve this?
I am getting following Exception on Android 2.2.1:
java.lang.NoSuchMethodError: java.lang.String.isEmpty
I am calling text.isEmpty
from Scala. Any idea, how to solve this?
Use JRE/JDK 1.5, which did not have an isEmpty
method on String
. This will avoid situations where Scala uses 1.6's isEmpty
instead of its own. If you have Java libraries as well, be sure to pick ones compatible with 1.5.
java.lang.String.isEmpty()
was added in Gingerbread (2.3). You will have to write your own replacement function...
isEmpty
implementation in IndexedSeqOptimized.isEmpty
. –
Backcross IndexedSeqOptimized
. The question is, why it is not using this trait? –
Backcross Use JRE/JDK 1.5, which did not have an isEmpty
method on String
. This will avoid situations where Scala uses 1.6's isEmpty
instead of its own. If you have Java libraries as well, be sure to pick ones compatible with 1.5.
Alternativly use (text.length()>0)
?
text.length == 0
. –
Backcross Use TextUtils.isEmpty() instead, available since API level 1.
© 2022 - 2024 — McMap. All rights reserved.