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?
You were right, Rafael T, that's an Eclipse bug...I have solved this using Ant builder (through terminal), and that worked :) Thanks again..
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With