java.lang.NoSuchMethodError: java.lang.String.isEmpty

116 views
Skip to first unread message

Andre Höpfner

unread,
Jun 10, 2013, 6:06:07 AM6/10/13
to mapsfo...@googlegroups.com
A tester reported a exception with 0.4.0

06-08 17:18:00.928 E/AndroidRuntime(28631): FATAL EXCEPTION: Thread-53
06-08 17:18:00.928 E/AndroidRuntime(28631): java.lang.NoSuchMethodError: java.lang.String.isEmpty
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.mapsforge.map.rendertheme.XmlUtils.getColor(XmlUtils.java:72)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.mapsforge.map.rendertheme.rule.RenderThemeBuilder.extractValues(RenderThemeBuilder.java:73)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.mapsforge.map.rendertheme.rule.RenderThemeBuilder.<init>(RenderThemeBuilder.java:48)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.mapsforge.map.rendertheme.rule.RenderThemeHandler.startElement(RenderThemeHandler.java:126)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:146)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.apache.harmony.xml.ExpatParser.append(Native Method)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:521)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:482)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:336)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:293)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at org.mapsforge.map.rendertheme.rule.RenderThemeHandler.getRenderTheme(RenderThemeHandler.java:71)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at CB_Core.Map.ManagerBase.getMapsforgePixMap(ManagerBase.java:559)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at de.cachebox_test.Map.AndroidManager.LoadLocalPixmap(AndroidManager.java:59)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at CB_Core.Map.ManagerBase.LoadInvertedPixmap(ManagerBase.java:137)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at CB_Core.Map.MapTileLoader.LoadTile(MapTileLoader.java:534)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at CB_Core.Map.MapTileLoader.access$3(MapTileLoader.java:527)
06-08 17:18:00.928 E/AndroidRuntime(28631):     at CB_Core.Map.MapTileLoader$queueProcessor.run(MapTileLoader.java:452)
06-08 17:18:01.139 W/ActivityManager(1388):   Force finishing activity de.cachebox_test/.main



I'll catch him, but maybe it's also possible to you, this does not even create.

colorString.isEmpty () seems not to be included on any device.

Maybe this would be a colorString.length ()> 0 will be better?

Greeting Andre

Ludwig

unread,
Jun 10, 2013, 6:22:50 AM6/10/13
to mapsfo...@googlegroups.com
String.isEmpty() is available from Android 9 (2.3), versions below Android 9 are not supported by the rewrite branch. You will need to adjust your AndroidManifest.

http://developer.android.com/reference/java/lang/String.html#isEmpty%28%29



--
You received this message because you are subscribed to the Google Groups "mapsforge-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapsforge-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

Andre Höpfner

unread,
Jun 12, 2013, 7:08:22 AM6/12/13
to mapsfo...@googlegroups.com

I can understand you, but this is the only place in all of the code used String.isEmpty().

And change this one line makes Mapsforge Level 8 Compatible what our users have confirmed!

Greeting Andre

Thilo Mühlberg

unread,
Jun 12, 2013, 4:07:24 PM6/12/13
to mapsfo...@googlegroups.com
According to http://developer.android.com/about/dashboards/index.html
less than five percent of all Android devices (which visit the Google
Play store) are using an API level < 9. Android 2.2 (aka "Froyo") was
released in Mai 2010, so it is already more than three years old.

This decision is an example of the Pareto principle. As our development
resources are very limited we simply cannot please everyone. Don't
forget that there are also other differences besides String.isEmpty()
and I do not even own a 2.2 device to test compatibility work-arounds.
Using the crappy emulator from the SDK instead is just a waste of time.
Therefore I do not strive for compatibility with such old API levels.

Best regards,
Thilo

On 12/06/13 13:08, Andre Höpfner wrote:
> I can understandyou, but this is the only place in all of the code used
signature.asc

Andre Höpfner

unread,
Jun 12, 2013, 4:19:47 PM6/12/13
to mapsfo...@googlegroups.com
I can understand that and our Developer Console on Google Play says that only 2.43% of our users are using 2.2.
But if
here already cry out our beta testers, then I have to try it at least.

And the old version String.length () == 0 works in all versions of Android.

And it's really only one place.

But as I said, I can understand you, but I would install a patched version for our users in us if I can not convince you, this one line to change!

Greeting Andre
Reply all
Reply to author
Forward
0 new messages