1

我的设置与我看到的 Android SDK 教程不同。我正在尝试设置与 Google Maps API 兼容的虚拟设备。我需要填写三个区域:设备和目标(教程仅显示目标)和 CPU。

我已将 Google API - API 级别 17 作为目标,但我不知道该为设备放置什么才能使其正常工作。

我不知道要为设备和 CPU 放什么才能让它工作。

这是我的日志输出: 11-17 00:12:38.403: W/ActivityManager(163): No content provider found for permission revoke: file:///data/local/tmp/GoogleMapsWithAndroid.apk 11-17 00:12 :38.443:W / ActivityManager(163):未找到用于权限撤销的内容提供者:file:///data/local/tmp/GoogleMapsWithAndroid.apk 11-17 00:12:38.633:I/PackageManager(163):删除非-系统包:com.example.googlemapswithandroid 11-17 00:12:38.633: I/ActivityManager(163): 强制停止包 com.example.googlemapswithandroid uid=10044 11-17 00:12:38.794: I/dalvikvm(163 ): Jit: 将 JitTable 的大小从 4096 调整为 8192 11-17 00:12:38.904: E/PackageManager(163): 包 com.example.googlemapswithandroid 需要不可用的共享库 com.google.android.maps;失败!11-17 00:12:38.913:W/PackageManager(163):无法在 /data/app/com.example 中安装包。

这是布局文件

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context=".MainActivity" >

    <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="0DGP89WIBvLjp6nNjqHdbvaaS71ITKsLNbPZV_g"
    />

</RelativeLayout>

这是我的清单

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

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="16" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <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.googlemapswithandroid.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>
        <activity android:name=".HelloGoogleMaps" android:label="@string/app_name"
     android:theme="@android:style/Theme.NoTitleBar">
         </activity>
    </application>

</manifest>
4

1 回答 1

1

由于 AVD 创建器的错误使用,我刚刚遇到了这个问题。

如果您在选择设备之前选择了 AVD 目标,则目标将被设备默认目标覆盖。

我以为我创建了一个 Google APIs 17 目标,而实际上它是一个没有谷歌地图的 Android 14。

我会仔细检查 AVD 配置,以确保您没有遇到同样的问题。

在此处输入图像描述

于 2012-11-17T14:10:24.903 回答