Friday, August 31, 2012

Android: failed to find style 'mapviewstyle' in current theme ?

It seems that the default style for MapView is specified with 'mapViewStyle', and the style 'mapViewStyle'  is defined  in Android public.xml file. But Android style 'mapViewStyle' is not defined in android styles.xml file. So I guess that the problem occurred.

So, I tried to solve that problem, as follows...

public.xml and styles.xml : You can find them in 'android-sdk/platforms/<android-api-level>/data/res/values folder.

1.GO-TO : android-sdk/platforms/ <android-api-level> /data/res/values 
2.In public.xml,  check the mapViewStyle's definition and id value.

3. In styles.xml,  insert 'mapViewStyle' item element as shown below.
(Note : 'mapViewStyle's id values' and insert point )

***  If you find anything that you think is wrong or unclear, please let me know by dropping a line in the comments section.


  1. Hello, thanks for posting a solution unfortunately it did not work for me. Also i believe the file you specified should be themes.xml instead of styles.xml.

    Cheers :)

  2. Where should I put the item name in styles.xml? What is the style_name before the item?