【问题标题】:Virtual Device supporting Google Maps API in Eclipse在 Eclipse 中支持 Google Maps API 的虚拟设备
【发布时间】:2012-11-16 20:55:21
【问题描述】:

我的设置与我看到的 Android 教程不同 开发工具包。我正在尝试设置与 Google 兼容的虚拟设备 地图 API。我需要填写三个区域:设备和目标( 教程只显示一个目标)和 CPU。

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

我不知道该为设备和 CPU 放置什么才能使其正常工作。

这是我的日志输出: 11-17 00:12:38.403: W/ActivityManager(163): 没有找到用于权限撤销的内容提供者: 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.googlemapswithandroid-1.apk 11-17 00:12:38.923: I/ActivityManager(163): 强制停止包 com.example.googlemapswithandroid uid=10044 11-17 00:12:38.980: W/PackageManager(163): 未知权限 com.google.android.googleapps.permission.GOOGLE_AUTH.mail 在包 com.android.contacts 11-17 00:12:38.983: W/PackageManager(163): 包 com.android.phone 中的未知权限 android.permission.ADD_SYSTEM_SERVICE 11-17 00:12:38.993: W/PackageManager(163): com.android.smspush.WAPPUSH_MANAGER_BIND 包 com.android.phone 中的未知权限 11-17 00:12:38.993: W/PackageManager(163): com.android.providers.calendar 包中的未知权限 com.google.android.googleapps.permission.GOOGLE_AUTH 11-17 00:12:38.993: W/PackageManager(163): com.android.providers.calendar 包中的未知权限 com.google.android.googleapps.permission.GOOGLE_AUTH.cl 11-17 00:12:38.993: W/PackageManager(163): com.google.android.googleapps.permission.GOOGLE_AUTH.mail 包中的未知权限 com.android.calendar 11-17 00:12:39.003: W/PackageManager(163): 不授予权限 android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS 到包 com.android.browser (protectionLevel=2 flags=0x9be45) 11-17 00:12:39.003: W/PackageManager(163): 不授予权限 android.permission.BIND_APPWIDGET 到包 com.android.widgetpreview (protectionLevel=18 flags=0x8be44) 11-17 00:12:39.023: W/PackageManager(163): com.android.providers.contacts 包中的未知权限 com.google.android.googleapps.permission.GOOGLE_AUTH 11-17 00:12:39.023: W/PackageManager(163): com.android.providers.contacts 包中的未知权限 com.google.android.googleapps.permission.GOOGLE_AUTH.cp 11-17 00:12:39.023: W/PackageManager(163): 包 com.android.settings 中的未知权限 com.google.android.googleapps.permission.GOOGLE_AUTH 11-17 00:12:39.053: W/PackageManager(163): com.android.development 包中的未知权限 com.google.android.googleapps.permission.ACCESS_GOOGLE_PASSWORD 11-17 00:12:39.053: W/PackageManager(163): com.android.development 包中的未知权限 com.google.android.googleapps.permission.GOOGLE_AUTH 11-17 00:12:39.063: W/PackageManager(163): 未知权限 com.google.android.googleapps.permission.GOOGLE_AUTH.ALL_SERVICES 在包 com.android.development 11-17 00:12:39.063: W/PackageManager(163): com.google.android.googleapps.permission.GOOGLE_AUTH.YouTubeUser 包 com.android.development 中的未知权限 11-17 00:12:39.063:W/PackageManager(163):未授予 android.permission.DEVICE_POWER 对 com.android.deskclock 包的权限(protectionLevel=2 flags=0x8be45)

这是布局文件

<?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>

【问题讨论】:

  • 那么您是否遵循本指南developers.google.com/maps/documentation/android/#avdsetup 您是否已将 标签添加到您的 AndroidManifest 中?
  • 我确实有这个,然后我看到另一个帖子说删除它以修复我遇到的错误需要不可用的共享库 com.google.android.maps 失败后,我把它拿出来跨度>
  • 您绝对应该在 AndroidManifest 中包含该行。
  • 对不起。我错过了编辑以前的评论。现在您已经格式化了 logcat,它看起来确实缺少一些东西。
  • 刚刚得到完全相同的堆栈跟踪,因为在 标签内的 AndroidManifest.xml 中没有以下行 。在运行 4.2 的 Galaxy Nexus 上测试

标签: android eclipse sdk maps


【解决方案1】:

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

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

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

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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2018-05-05
  • 2022-01-22
  • 1970-01-01
  • 1970-01-01
  • 2011-11-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多