Scala on Android: java.lang.NoSuchMethodError: java.lang.String.isEmpty

TN. picture TN. · Dec 9, 2010 · Viewed 8.1k times · Source

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?

Answer

Reuben Scratton picture Reuben Scratton · Dec 9, 2010

java.lang.String.isEmpty() was added in Gingerbread (2.3). You will have to write your own replacement function...