Click here to Skip to main content
11,644,284 members (70,636 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Android
This is my google map view code where i find this error in xml Failed to find style 'mapViewStyle, i found a lot in google but i didn't get proper solution.

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mapView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey=API KEY"
/>
Posted 23-Sep-12 22:42pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You have to enter the Google MAPS API key only then this code will work.


<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/mapView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey=API KEY"
/>


In place of API KEY, you have to enter the MAPS API KEY which is generated by google.
You'll get the link here. https://developers.google.com/maps/documentation/android/mapkey[^]
  Permalink  
Comments
AndroidVivek at 25-Sep-12 4:16am
   
Aditya : After making this error come..
I can't write here API key that why i write API key..
Aditya_Pandey at 25-Sep-12 4:21am
   
You have to generate the API key.
follow the link given to you.
Aditya_Pandey at 25-Sep-12 4:22am
   
Go through this link. https://developers.google.com/maps/
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

use style="mapViewStyle" and styles="mapViewStyle" together it will not remove error but it will not gives you problem to see the map and other controls for it.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 690
1 jyo.net 494
2 Sergey Alexandrovich Kryukov 429
3 Afzaal Ahmad Zeeshan 418
4 CPallini 336
0 OriginalGriff 925
1 DamithSL 636
2 Afzaal Ahmad Zeeshan 622
3 Sergey Alexandrovich Kryukov 548
4 CPallini 521


Advertise | Privacy | Mobile
Web03 | 2.8.150731.1 | Last Updated 9 Oct 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100