'Failed to find style mapViewStyle' error persists

后端 未结 5 2034
忘了有多久
忘了有多久 2020-12-20 11:20

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

相关标签:
5条回答
  • 2020-12-20 11:34
    <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.

    0 讨论(0)
  • 2020-12-20 11:40

    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"/>

    0 讨论(0)
  • 2020-12-20 11:44

    I'd suggest to take a look at the Maps demo app. This comes bundle with the Google Play services lib, in your SDK manager just include the checkbox for Samples for Google Play Services. You then can find the project files @ <android-sdk>/extras/google-play-services/samples/maps in your SDK directory.

    0 讨论(0)
  • 2020-12-20 11:46

    I think com.google.android.maps.MapView is now obsoleted now i used com.google.android.gms.maps.MapView. Please check http://developer.android.com/reference/com/google/android/gms/maps/MapView.html for help and If you want to use MapFragment then go through http://www.androidhive.info/2013/08/android-working-with-google-maps-v2/ Url.

    0 讨论(0)
  • 2020-12-20 11:50

    these are the permissions you should have normally for a map v2

     <permission
        android:name="com.example.gmapsapp.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />
    
    <uses-permission android:name="com.example.gmapsapp.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission   android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"    />
    

    and the api key is now used in manifest file with meta tag

        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="@string/apikey />
    

    here I am including a xml file example of gmaps

    <fragment xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/map"
    android:name="com.google.android.gms.maps.SupportMapFragment"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />
    
    0 讨论(0)
提交回复
热议问题