0

I saw so many answer of this question here but not one solve my problem. I am trying to make a tab layout I which there is text is text view in table layout and below table layout I want to add map. and I'm trying to do this but not get the result. my error is

Failed to find style 'mapViewStylr' in current theme

after adding the MapView I got this error. and when I run the code on Nexus one and try to open the layout in which I added the MapView then the application Unfortunately stopped.

here is my layout code

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" 
    android:background="@android:color/white"
   >
<ScrollView 
    android:id="@+id/info_tab"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content" 
   >

<RelativeLayout
    android:id="@+id/venuinfolayout"
    android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" 
        android:background="@android:color/white" >

<TableLayout
    android:id="@+id/venuetable"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:fitsSystemWindows="true"
    android:weightSum="2"
    > 
<TableRow 
    android:layout_width="fill_parent"    
    android:layout_height="wrap_content"        
    android:layout_weight="1">

     <TextView 
        android:id="@+id/venueaddress"
        android:text="Address:"
        android:textColor="@android:color/black"
        android:padding="6dip"
        android:textStyle="bold"
        android:textSize="20dip" />

    <TextView 
        android:id="@+id/venueaddress_details"
        android:layout_height="wrap_content"
        android:layout_width="180dip"
        android:singleLine="false"
        android:layout_toRightOf="@id/venueaddress"
        android:textColor="@android:color/black"
        android:text="text" 
        android:layout_marginLeft="10dip"
        android:padding="6dip"
        android:textSize="15dip"
        />

    </TableRow>

<TableRow 
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_weight="1">


    <TextView 
        android:id="@+id/venuephone"
        android:layout_below="@id/venueaddress"
        android:text="Phone:" 
        android:textColor="@android:color/black"
        android:padding="6dip"
        android:textStyle="bold"
        android:textSize="20dip" />

    <TextView 
        android:id="@+id/venuephone_details"
        android:layout_below="@id/venueaddress_details"
        android:layout_toRightOf="@id/venuephone"
        android:text="number"
        android:textColor="@android:color/black"
        android:layout_marginLeft="10dip"
        android:padding="6dip"
        android:textSize="15dip" />
</TableRow>
</TableLayout>

<com.google.android.maps.MapView
    android:id="@+id/mapview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@id/venuetable"
    android:clickable="true"
    android:apiKey="AIzaSyAvWazTUUQr88b_UqQvB4k5rPAtOhlxTFA" />


</RelativeLayout>
</ScrollView>
</RelativeLayout>
BenMorel
  • 34,448
  • 50
  • 182
  • 322
vikram raj
  • 37
  • 8
  • `com.google.android.maps.MapView` is part of the deprecated Google Maps Android API v1. If you don't have a debug and release API keys generated, consider switching to API v2 (you won't have API v1 showing the map). – MaciejGórski Jun 21 '13 at 10:37
  • I generated the API keys. but still not working. – vikram raj Jun 21 '13 at 11:05

2 Answers2

0

I had the same problem when I try to build a simple app, following the Android MapView tutorial.

The app showed this exception in AVD for the file file main.xml:

Failed to find style 'mapViewStyle' in current theme

At last I found that there is a mistake in file AndroidManifest.xml:

The element should be a child of the element, not immediately within .

Hope this was any help to you.

OR

look Here

Community
  • 1
  • 1
ashish.n
  • 1,234
  • 14
  • 30
0
//try this it may help you 

Add this into your manifest file

<uses-library android:name="com.google.android.maps" />
Nas
  • 2,158
  • 1
  • 21
  • 38
  • I have already this in my manifest file. still getting the error – vikram raj Jun 21 '13 at 10:54
  • api key of google maps api v1 are deprecated from google maps. currently you cant develop your mapview application by google maps api v1. – Nas Jun 24 '13 at 09:11