Virtual Device supporting Google Maps API in Eclipse
I have a different setup than the tutorials I have been seeing for the Android SDK. I am trying to setup a virtual device that is compatible with the Google Maps API. I have three areas I need to fill out: the device and the target (the tutorials only show a target) and the CPU.
I have put Google APIs - API Level 17 as the target but I don't know what to put for device to get it to work.
I don't know what to put for device and CPU to get it to work.
Here is my log output: 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): No content provider found for permission revoke: file:///data/local/tmp/GoogleMapsWithAndroid.apk 11-17 00:12:38.633: I/PackageManager(163): Removing non-system package:com.example.googlemapswithandroid 11-17 00:12:38.633: I/ActivityManager(163): Force stopping package com.example.googlemapswithandroid uid=10044 11-17 00:12:38.794: I/dalvikvm(163): Jit: resizing JitTable from 4096 to 8192 11-17 00:12:38.904: E/PackageManager(163): Package com.example.googlemapswithandroid requires unavailable shared library com.google.android.maps; failing! 11-17 00:12:38.913: W/PackageManager(163): Package couldn't be installed in /data/app/com.example.googlemapswithandroid-1.apk 11-17 00:12:38.923: I/ActivityManager(163): Force stopping package com.example.googlemapswithandroid uid=10044 11-17 00:12:38.980: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.mail in package com.android.contacts 11-17 00:12:38.983: W/PackageManager(163): Unknown permission android.permission.ADD_SYSTEM_SERVICE in package com.android.phone 11-17 00:12:38.993: W/PackageManager(163): Unknown permission com.android.smspush.WAPPUSH_MANAGER_BIND in package com.android.phone 11-17 00:12:38.993: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.providers.calendar 11-17 00:12:38.993: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.cl in package com.android.providers.calendar 11-17 00:12:38.993: W/PackageMana ger(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.mail in package com.android.calendar 11-17 00:12:39.003: W/PackageManager(163): Not granting permission android.permission.SEND_DOWNLOAD_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x9be45) 11-17 00:12:39.003: W/PackageManager(163): Not granting permission android.permission.BIND_APPWIDGET to package com.android.widgetpreview (protectionLevel=18 flags=0x8be44) 11-17 00:12:39.023: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.providers.contacts 11-17 00:12:39.023: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.cp in package com.android.providers.contacts 11-17 00:12:39.023: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.settings 11-17 00:12:39.053: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.ACCESS_GOOGLE_PASSWORD in package com.android.development 11-17 00:12:39.053: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH in package com.android.development 11-17 00:12:39.063: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.ALL_SERVICES in package com.android.development 11-17 00:12:39.063: W/PackageManager(163): Unknown permission com.google.android.googleapps.permission.GOOGLE_AUTH.YouTubeUser in package com.android.development 11-17 00:12:39.063: W/PackageManager(163): Not granting permission android.permission.DEVICE_POWER to package com.android.deskclock (protectionLevel=2 flags=0x8be45)
Here is the layout file
<?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>
Here is my manifest
<?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>
I've just experienced this issue because of a wrong usage of the AVD creator.
If you select the AVD Target before selecting the Device, the target will be overwrite with the device default Target.
I thought i had created a Google Apis 17 target, when actually it was a Android 14 without google maps.
I would double check the AVD configuration just to make sure you didn't fall into the same issue.
链接地址: http://www.djcxy.com/p/85338.html