我遵循这些网站中的所有步骤:
https://developers.google.com/maps/documentation/android/v1/hello-mapview
我还下载了 play-services-sdk。
但是我仍然收到一条错误消息:
The import com.google.android.maps cannot be resolved
而且我也不能扩展 MapActivity:
这是我的 manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sale"
android:versionCode="1"
android:versionName="1.0" >
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="10" />
<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="android.permission.CAMERA"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<permission
android:name="com.example.mapdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.sale.permission.MAPS_RECEIVE"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name="com.example.sale.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Entry for RegisterActivity.class -->
<activity android:name=".RegisterActivity"
android:label="Register New Account"></activity>
<meta-data android:value="@string/app_id" android:name="com.facebook.sdk.ApplicationId"/>
<activity android:label="@string/app_name" android:name="com.facebook.LoginActivity"></activity>
<activity android:name=".ProfileActivity" android:label="Profile page"></activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDTVRXMTmfe3jZyAlt-87kRgqM8y4TzIto"/>
</application>
</manifest>
这是我开始创建的 MapActivity(但是它不识别 MapActivity):
package com.example.sale;
import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.MapActivity;
public class SaleMapActivity extends MapActivity {
}
问题是什么?我遵循所有步骤并在谷歌中阅读了很多内容,但没有答案。如何解决?