English 中文(简体)
未能找到风格的图像
原标题: 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
/>

AndersManifest.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>

我高度赞赏事先提供的任何帮助。

问题回答

您必须包括:<条码>/第_to_android-sdk/extras/google/google_play_services/libproject/google-play-services_lib。 图书馆作为外部图书馆纳入贵项目,并包括这一文献:/path_to_android-sdk/extras/google/google_play_services/libproject/google-play-services_lib/libs/google-play-services.jar

除此以外,您应获得这些许可:

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

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

请在您的Manifest档案中添加上述内容。

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.

我建议研究地图。 这与谷歌游戏服务校准一样,在您的SDK经理中,这只是谷歌游戏服务的抽样检查箱。 然后,你可以发现项目文件<android-sdk>/extras/google-play-services/samples/maps

这些是你通常对地图2的许可。

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

我在此附上一份Xml文档例子,以示地图。

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




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签