Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在项目或库中找不到com.google.android.maps.MapView_Android_Eclipse_Google Maps - Fatal编程技术网

在项目或库中找不到com.google.android.maps.MapView

在项目或库中找不到com.google.android.maps.MapView,android,eclipse,google-maps,Android,Eclipse,Google Maps,我在这个问题上已经讨论了好几天了,没有任何进展 在main.xml中,我收到一个错误消息: “布局文件com.google.android.maps.MapView中引用的类, 在项目或库中找不到“ 这让我很困惑,正如我在谷歌API中看到的MapView.class[Android 2.3.3] maps.jar 对解决这个问题有什么想法吗?这真让我讨厌,我找不到 我自己的解决方案 我的API密钥是Ver。二, 我正在使用Eclipse-Android开发工具构建:v22.0.0-675183

我在这个问题上已经讨论了好几天了,没有任何进展

在main.xml中,我收到一个错误消息: “布局文件com.google.android.maps.MapView中引用的类, 在项目或库中找不到“

这让我很困惑,正如我在谷歌API中看到的MapView.class[Android 2.3.3] maps.jar

对解决这个问题有什么想法吗?这真让我讨厌,我找不到 我自己的解决方案

我的API密钥是Ver。二,

我正在使用Eclipse-Android开发工具构建:v22.0.0-675183

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>

<com.google.android.maps.MapView
    android:id="@+id/mapView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:enabled="true"
    android:clickable="true"
    android:apiKey="AIzaSyCSeU48SfPfRRuA-3YycsVxd_s9MFV8g3M"
    />
</LinearLayout>

舱单呢

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

<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="18" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<permission
android:name="com.tit.GPSLocator.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission  android:name="com.tit.GPSLocator.permission.MAPS_RECEIVE" />
<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" />    
<uses-permission android:name="android.permission.INTERNET" />

<application 
    android:icon="@drawable/icon"
    android:label="@string/app_name"
    android:allowBackup="true">

    <uses-library android:name="com.google.android.maps" />
    <activity android:name="com.tit.GPSLocator.GPSLocatorActivity"
            android:label="@string/app_name">
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyCSeU48SfPfRRuA-3YycsVxd_s9MFV8g3M" />

        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

</application>
</manifest>


最有可能的是,您首先不应该使用
com.google.android.maps.MapView
。这适用于不推荐使用的Maps V1 API。您正在做的所有其他事情——特别是API密钥——都来自

好的,在将
元数据API键
移动到
活动
中之后,我再次清理了项目,我可以运行应用程序了。我在地图上获得了网格,但没有地图分幅:
java.io.IOException:Server返回:3
但这是另一个问题。

您尝试过清理项目吗?哦,是的。好几次。无论如何,谢谢:)好的,在将API密钥移到内部后,我再次清理了项目,并且可以运行应用程序。我在地图上看到了网格,但没有地图分幅:“java.io.IOException:Server returned:3”但这是另一个问题。是的,我看到了一些关于MapView被弃用的信息,但后来我发现了这一点:没有提到弃用。无论如何,我不认为这与API版本有关,因为我在Google API[Android 2.3.3]maps.jar中看到MapView.class,所以它就在那里。@MogensBurapa:“是的,我看到一些关于MapView被弃用的内容,但后来我发现了这个:链接,没有提到弃用的内容”——这不是您正在使用的类。该页面用于MapsV2
MapView
,即
com.google.android.gms.Maps.MapView
。你没有用那个。您使用的是
com.google.android.maps.MapView
,它是mapsv1
MapView
。不要将地图V1与地图V2混合匹配。但仍要。类在其中,应该被Eclipse识别。