【发布时间】:2014-01-02 08:36:59
【问题描述】:
好的,所以我有一个正在运行的应用程序,我正在 2 个基于 API 8 和另一个基于 API 11 的 Android 模拟器中进行测试。该应用程序在 API 11 中运行良好,但在 API 8 中由于无法获取而失败连接工厂客户端错误消息。
我想知道这是否与几件事有关
- 也许我需要为不同的构建获取不同的 Google Maps API 密钥?
- 也许我需要在我的 Manifest 文件中声明不同的声明才能使其适用于不同的构建?
- 也许还有别的?
在项目属性中,我选择了作为 Google Maps API 8 的项目构建目标,并下载了我需要的所有适当的 SDK。
非常感谢您的任何帮助,感谢您的关注,同时这是我的清单文件...
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.rogw.p352lbs"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name="net.rogw.p352lbs.MainActivity"
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>
</application>
</manifest>
这是我的布局文件,我没有添加 java 文件,因为它很长,并且适用于 API 11 模拟器:-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<com.google.android.maps.MapView
android:id="@+id/mapView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:apiKey="Key is not shown here but it is a valid string"
android:clickable="true"
android:enabled="true" />
</LinearLayout>
【问题讨论】:
-
您使用的是哪个 apiversion api v1 或 api v2?。看起来您正在使用已弃用的 api v1。
-
API V2 我认为但不确定我知道如何检查。
-
我在应用程序标签中看不到元标签。你参考谷歌播放服务库项目吗? developers.google.com/maps/documentation/android
-
同时发布您的活动代码和 xml 布局代码
标签: android client maps factory