Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'Failed to find style mapViewStyle' error persists

I've been working on this app for almost a year now (senior project) when it just decided to break a few days ago. My application has been developed using Eclipse version 3.7.2 64bit targeting Froyo Android 2.2, using my Windows 7 64bit pc. So far I have tried:

  • rearranging the uses-library tag in the manifest file
  • rewriting the map xml file
  • deleting the R.java file and refreshing
  • placing the mapview element within a layout
  • reinstalling eclipse and the android-sdk
  • cleaning the project
  • creating a style.xml file and referencing it
  • deploying on a actual device
  • reverting back to previous code

and possibly more...

My code is as follows: gmap.xml

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="0xMbgnc-el963gCdpl547hdkgXUILTskZr-T5uvg" // random key posted here
/>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.PubMe"
  android:versionCode="1"
  android:versionName="1.0">

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


<application android:icon="@drawable/icon" android:label="@string/app_name">
    <uses-library android:name="com.google.android.maps" />
    <activity android:name=".PubMeActivity"
              android:label="@string/app_name"
              android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name=".MappingActivity"
              android:label="@string/app_name">
    </activity>

</application>
</manifest>

I highly appreciate any help in advance.

like image 305
MechaJDI Avatar asked Apr 24 '12 17:04

MechaJDI


2 Answers

You must include /path_to_android-sdk/extras/google/google_play_services/libproject/google-play-services_lib Library as a external library into your project and also include this jar file /path_to_android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar.

beside those, you should have these permissions:

<uses-permission android:name="android.permission.INTERNET" /> **<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>** <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

like image 138
Sadegh Avatar answered Nov 09 '22 09:11

Sadegh


<permission
android:name="com.example.app.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.app.permission.MAPS_RECEIVE"/>

Try to add the above in your Manifest file.

like image 29
user2919740 Avatar answered Nov 09 '22 07:11

user2919740