I am trying to use maps in my application and i get this error,
Failed to find style ‘mapViewStyle’ in current theme
i have generated the key properly, and have tried all solutions offered for the same problem at other places.
1.my target api and the one mentioned in the manifest file are the same.
2.There is no import.R in my project
3.I have cleaned my project.
4.Uses-library element is a child of the application.
This is my xml file
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
android:id="@+id/mapview1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:apiKey="*****************"
android:enabled="true"
/>
</LinearLayout>
and this is my corresponding java file
package com.epidemicator.prototype;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class Mapacti extends MapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapview);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
please help me out here…
thanks.
My answer may be a late one, but i hope that it’ll deals with the actual reason and sure it could be helpful for those who are going to search about the same problem in future.
This type of errors,
Anything from the above list it may be,
The ultimate reason is ,
We have selected the unavailable
Themefor thelayout.This may occur because of the following reasons,
themeis not available inthemes.xmlfile.themeis belongs to higher versionsdk, but our current targetsdkis lower one.This problem mostly happens,
layoutfile and try to implement it in yourproject.a. Your may forgot to copy
themes.xmlfileb. You may have lower
target sdk, the originallayoutcreated with highertarget sdk.The Solutions for this problem are,
(Open and View the
layoutfile in theGraphical Layout View, and look at the top Right corner.There your
themesfor thelayouthave been selected.)themeselection and choose the availablethemesaccording to your projectthemesandtargeted sdk themes.(OR)
themeis acustomone , if you are required it , then copy thethemes.xmlfile to your project from the source where you copied thelayout xmlfile.(OR)
themeissdkavailtheme, if you are required it , then change yourtargetaccording to your selectedtheme.Hope – This might be helpful for somebody.