When adding a google map view (I extended a MapView, used the xml editor to add it to the Activity, and added my google maps api key to the layout xml file manually)
My permissions allow Internet in the manifest file
What i’m wondering, is in the xml editor i get the error “Failed to find style ‘mapViewStyle’ in current theme” but i seem to have everything set up correctly.
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
Failed to find style ‘mapViewStyle’ in current theme
At last I found that there is a mistake in file
<uses-library android:name="com.google.android.maps" />
should be a child of the
<application> element, not immediately within
Hope this was any help to you.
For what its worth…
My experience is that I got this in the UI Designer, but it did not break the build. I assume it is an Eclipse / Android SDK bug.
My app has been working perfectly on the store until I upgraded my SDK to version 20. It leads me to believe this is something to do with the SDK.
Of the various answers to this question (and duplicates) I found, none of them helped:
not changing the target SDK
not clean & build
not declaring a style manually
Finally, these questions are all duplicates (and mostly useless as confirmed by Ewok):
- Android Google Maps Failed to find style 'mapViewStyle' in current theme
- Let's solve the "Failed to find style 'mapViewstyle' in current theme" error
- Google Maps in Android: Failed to find style 'mapViewStyle' in current theme
- 'Failed to find style mapViewStyle' error persists
- Android maps:Failed to find style 'mapViewStyle' in current theme
- Android – Failed to find style 'mapViewStyle' in current theme
- Android "Failed to find style 'mapViewStyle' in current Theme" error
- Failed to find style 'mapViewStyle' in current theme
I tried to point this out to the moderators but I was ignored…
I had the same issue when creating a Google Map view that worked well until I cleaned the project after placing a new icon.png in a drawable folder (Project >> Clean). Many times the cleaning process will install an import statement at the top program code, which overrides the R.java file in your project. The solution was to simply remove the following import statement:
after the project was saved and rebuilt without issue.
I was having the same problem, and it turned out the problem was I had targeted the app towards the Google 4.0 APIs, but in the Manifest file specified Android API 10 (2.3.3).
Once I changed the project’s target from 4.0 to 2.3.3 (API 10), it worked better.
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,
1. Android Google Maps Failed to find style 'mapViewStyle' in current theme 2. Failed to find style 'imageButtonStyle' in current theme 3. Failed to find style 'editTextStyle' in current theme 4. Failed to find style 'textViewStyle' in current theme
Anything from the above list it may be,
The ultimate reason is ,
We have selected the unavailable
Theme for the
This may cause because of,
- The selected
themeis not available in
- The selected
themeis belongs to higher version
sdk, but our current target
sdkis lower one.
This problem mostly happens,
- when you copy the whole
layoutfile and try to implement it in your
a. Your may forgot to copy
b. You may have lower
target sdk, the original
layoutcreated with higher
The Solutions for this problem are,
(Open and View the
layout file in the
Graphical Layout View, and look at the top Right corner.
themes for the
layout have been selected.)
- So click the dropdown list for
themeselection and choose the available
themesaccording to your project
targeted sdk themes.
- If the
customone , if you are required it , then copy the
themes.xmlfile to your project from the source where you copied the
- If the
theme, if you are required it , then change your
targetaccording to your selected
Hope,This might be helpful for somebody.
This is how I solved this problem.
I had in my application google maps too, and I change:
with new created key (new key didn’t work) and error was:
Failed to find style 'mapViewStyle' in current theme
after returning old key everithing worked fine.
I really hate developing for android it’s mess comparing to Visual studio development.
this problem cost me 4h …
To re-create debug.keystore use this "Debug certificate expired" error in Eclipse Android plugins