Skip to main content

Android Google Maps Failed to find style "mapViewStyle" in current theme


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.


Source: Tips4allCCNA FINAL EXAM

Comments

  1. 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 <uses-library android:name="com.google.android.maps" />
    should be a child of the <application> element, not immediately within <manifest>.

    Hope this was any help to you.

    ReplyDelete
  2. 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:

    import android.R

    after the project was saved and rebuilt without issue.

    ReplyDelete
  3. 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.

    ReplyDelete

Post a Comment

Popular posts from this blog

Why is this Javascript much *slower* than its jQuery equivalent?

I have a HTML list of about 500 items and a "filter" box above it. I started by using jQuery to filter the list when I typed a letter (timing code added later): $('#filter').keyup( function() { var jqStart = (new Date).getTime(); var search = $(this).val().toLowerCase(); var $list = $('ul.ablist > li'); $list.each( function() { if ( $(this).text().toLowerCase().indexOf(search) === -1 ) $(this).hide(); else $(this).show(); } ); console.log('Time: ' + ((new Date).getTime() - jqStart)); } ); However, there was a couple of seconds delay after typing each letter (particularly the first letter). So I thought it may be slightly quicker if I used plain Javascript (I read recently that jQuery's each function is particularly slow). Here's my JS equivalent: document.getElementById('filter').addEventListener( 'keyup', function () { var jsStart = (new Date).getTime()...

Is it possible to have IF statement in an Echo statement in PHP

Thanks in advance. I did look at the other questions/answers that were similar and didn't find exactly what I was looking for. I'm trying to do this, am I on the right path? echo " <div id='tabs-".$match."'> <textarea id='".$match."' name='".$match."'>". if ($COLUMN_NAME === $match) { echo $FIELD_WITH_COLUMN_NAME; } else { } ."</textarea> <script type='text/javascript'> CKEDITOR.replace( '".$match."' ); </script> </div>"; I am getting the following error message in the browser: Parse error: syntax error, unexpected T_IF Please let me know if this is the right way to go about nesting an IF statement inside an echo. Thank you.