8

I've a little problem with my Android Maps Application. So that when I added MapView to my layout xml file it shows me "Failed to find style 'mapViewStyle' in current theme" error message.

Here's my AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.acilSRV.client"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="10" />

    <application android:icon="@drawable/icon" android:label="@string/app_name">

    <uses-library android:name="com.google.android.maps"/>
        <activity android:name=".AcilActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

</manifest>

And main.xml where that error message appears:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
<TextView  
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:text="@string/hello"
    />

   <com.google.android.maps.MapView
    android:id="@+id/myMapView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:enabled="true"
    android:clickable="true"
    android:apiKey="*******"
  />

</LinearLayout>

Note: I have already checked my Google Maps api key and there's no problem with api key.

Any suggestions?

Zaur Guliyev
  • 4,254
  • 7
  • 28
  • 44
  • have you selected a build target that includes GoogleApis? – Rafael T Dec 14 '11 at 23:51
  • yes, Google Apis - 10 (2.3.3 version) – Zaur Guliyev Dec 14 '11 at 23:53
  • possible mirror of this question: http://stackoverflow.com/questions/6975203/android-google-maps-failed-to-find-style-mapviewstyle-in-current-theme – Rafael T Dec 14 '11 at 23:59
  • I've already tried all this solutions that error still appears... – Zaur Guliyev Dec 15 '11 at 00:04
  • try to build with ant to clearify if it's an Eclipse Bug – Rafael T Dec 15 '11 at 00:05
  • Btw when I type "keytool -list -keystore ~/.android/debug.keystore" into terminal I get "Enter keystore password:" prompt and when I type Enter, it shows me Warning message before showing up a fingerprint...The Warning message is: "The integrity of the information stored in your keystore has NOT been verified!In order to verify its integrity,you must provide your keystore password." – Zaur Guliyev Dec 15 '11 at 00:10

2 Answers2

4

You were right, Rafael T, that's an Eclipse bug...I have solved this using Ant builder (through terminal), and that worked :) Thanks again..

Zaur Guliyev
  • 4,254
  • 7
  • 28
  • 44
1

This happened to me too.. go into res>values>styles.xml

remove the previous theme line and put this one

<style name="AppBaseTheme" parent="android:Theme.Light" />

During the project creation, Eclipse asks to define a theme for the application. You might have selected any Holo theme. This theme doesn't support MapView which is showing the error.

Abandoned Cart
  • 4,512
  • 1
  • 34
  • 41
Rohan Kandwal
  • 9,112
  • 8
  • 74
  • 107