Mapview无法在android设备上工作
我正在尝试使用Mapview查找两个城市之间的路径 问题是Mapview无法工作,仅在设备中获取灰色网格和块而不是地图,但在模拟器中工作良好 这是我的舱单Mapview无法在android设备上工作,android,android-maps,android-mapview,Android,Android Maps,Android Mapview,我正在尝试使用Mapview查找两个城市之间的路径 问题是Mapview无法工作,仅在设备中获取灰色网格和块而不是地图,但在模拟器中工作良好 这是我的舱单 <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.MapDirection" android:versionCode="1" andr
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.MapDirection"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-library android:name="com.google.android.maps" />
<activity
android:label="@string/app_name"
android:name=".MapDirectionActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
</manifest>
以下是我的布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="xxxxxxxxxxxxxxxxxxxxxx"
/>
</LinearLayout>
仅在设备中获取灰色网格和块而不是贴图,但在模拟器中效果良好
要么:
apiKey
,或者(第三种可能是缺少
互联网
权限,但看起来您拥有该权限)好的。。。“调试”的API密钥仅在模拟器上有效。如果您使用Eclise以“调试模式”将软件加载到手机,您将获得互动程序,而不是地图。如果您使用“release”API密钥更新mapview,然后使用Eclipse“EXPORT”创建apk文件,将其复制到手机上的sd卡上,然后使用安装程序应用程序(从Google Play免费下载)将其安装到手机上 解决了问题…在为应用程序的APK签名时,请确保为MD5指纹签名的密钥也相同。