2

I am trying to launch an android native app that displays a Google Map in an Android Emulator. However, I am not able to do that in the Emulator.

Initially I tried to do this using MapView. I am using Google Play Servicesversion 4, it does not like Google Play Services version 6 (latest)

main.xml

<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="<my_api_key>" />

AndroidManifest.xml

    <uses-sdk
        android:minSdkVersion="10"
        android:targetSdkVersion="10" />
    <uses-permission android:name="android.permission.INTERNET"/>        

    <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.ccc.mygooglemaps.MyMapsActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

MyMapsActivity.java

package com.ccc.mygooglemaps;

import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;

import android.os.Bundle;
import android.view.Menu;

public class MyMapsActivity extends MapActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        MapView mapView = (MapView) findViewById(R.id.mapview);
        mapView.setBuiltInZoomControls(true);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is
                present.getMenuInflater().inflate(R.menu.my_maps, menu);
        return true;
    }

    @Override
    protected boolean isRouteDisplayed() {
        // TODO Auto-generated method stub
        return false;
    }
}

The following are the LogCat (logs) from launching the MyMapsApp.apk app in the Emulator:

<br>05-03 17:37:28.936: W/ActivityThread(420): Application com.ccc.mygooglemaps is waiting for the debugger on port 8100...
<br>05-03 17:37:28.947: I/System.out(420): Sending WAIT chunk
<br>05-03 17:37:28.957: I/dalvikvm(420): Debugger is active
<br>05-03 17:37:28.976: I/System.out(420): Debugger has connected
<br>05-03 17:37:28.976: I/System.out(420): waiting for debugger to settle...
<br>05-03 17:37:30.842: I/System.out(420): debugger has settled (1405)
<br>05-03 17:37:42.516: D/dalvikvm(420): GC_CONCURRENT freed 273K, 45% free 3399K/6151K, external 410K/517K, paused 3ms+5ms
<br>05-03 17:37:51.552: D/AndroidRuntime(420): Shutting down VM
<br>05-03 17:37:51.552: W/dalvikvm(420): threadid=1: thread exiting with uncaught exception (group=0x40015560)
<br>05-03 17:37:51.716: E/AndroidRuntime(420): FATAL EXCEPTION: main
<br>05-03 17:37:51.716: E/AndroidRuntime(420): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ccc.mygooglemaps/com.ccc.mygooglemaps.MyMapsActivity}: android.view.InflateException: Binary XML file line #1: Error inflating class com.google.android.maps.MapView
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.app.ActivityThread.access$1500(ActivityThread.java:117)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.os.Handler.dispatchMessage(Handler.java:99)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.os.Looper.loop(Looper.java:130)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.app.ActivityThread.main(ActivityThread.java:3683)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at java.lang.reflect.Method.invokeNative(Native Method)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at java.lang.reflect.Method.invoke(Method.java:507)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at dalvik.system.NativeStart.main(Native Method)
<br>05-03 17:37:51.716: E/AndroidRuntime(420): Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class com.google.android.maps.MapView
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.view.LayoutInflater.createView(LayoutInflater.java:518)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:570)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.view.LayoutInflater.inflate(LayoutInflater.java:386)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.app.Activity.setContentView(Activity.java:1657)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at com.ccc.mygooglemaps.MyMapsActivity.onCreate(MyMapsActivity.java:24)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  ... 11 more
<br>05-03 17:37:51.716: E/AndroidRuntime(420): Caused by: java.lang.reflect.InvocationTargetException
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at java.lang.reflect.Constructor.constructNative(Native Method)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at android.view.LayoutInflater.createView(LayoutInflater.java:505)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  ... 20 more
<br>05-03 17:37:51.716: E/AndroidRuntime(420): Caused by: java.lang.IllegalArgumentException: You need to specify an API Key for each MapView.  See the MapView documentation for details.
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at com.google.android.maps.MapView.<init>(MapView.java:283)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at com.google.android.maps.MapView.<init>(MapView.java:264)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  at com.google.android.maps.MapView.<init>(MapView.java:247)
<br>05-03 17:37:51.716: E/AndroidRuntime(420):  ... 23 more
<br>05-03 17:37:52.106: D/dalvikvm(420): GC_CONCURRENT freed 687K, 51% free 3112K/6279K, external 410K/517K, paused 4ms+5ms
<br>05-03 17:42:52.086: I/Process(420): Sending signal. PID: 420 SIG: 9

AVD (Emulator):

<br>AVD Name:  MyMaps
<br>Device:  3.4" WQVGA (240 x 432:lpi)
<br>Target:  Google APIs (Google Inc.) - API Level 10
<br>CPU/ABI:  ARM (armeabi)

==================================================================================

Then I tried to do this using SupportMapFragment. I am using Google Play Services version 4, it does not like Google Play Services version 6 (latest)

main.xml

<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=".MyMapsAppAPIv2Activity" >

    <fragment 
        android:id="@+id/map"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        class="com.google.android.gms.maps.SupportMapFragment"/>

</RelativeLayout>

AndroidManifest.xml

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

    <uses-sdk
        android:minSdkVersion="15"
        android:targetSdkVersion="15" />

    <permission
        android:name="com.ccc.mygooglemaps.permission.MAPS_RECEIVE"
        android:protectionLevel="signature" />

    <uses-feature 
        android:glEsVersion="0x00020000"
        android:required="true"/>

    <uses-permission android:name="com.ccc.mygooglemaps.permission.MAPS_RECEIVE" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.ccc.mygooglemaps.MyMapsAppAPIv2Activity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="<my_api_key>" />
    </application>

</manifest>

MyMapsAppAPIv2Activity.java

        package com.ccc.mygooglemaps;

        import com.google.android.gms.common.GooglePlayServicesUtil;
        import com.google.android.gms.maps.CameraUpdateFactory;
        import com.google.android.gms.maps.GoogleMap;
        import com.google.android.gms.maps.SupportMapFragment;
        import com.google.android.gms.maps.model.CameraPosition;
        import com.google.android.gms.maps.model.LatLng;
        import com.google.android.gms.maps.model.MarkerOptions;

        import android.os.Bundle;
        import android.support.v4.app.FragmentActivity;
        import android.view.Menu;

        public class MyMapsAppAPIv2Activity extends FragmentActivity {
            private static final LatLng SYDNEY = new LatLng(-33.88,151.21);
            private static final LatLng MOUNTAIN_VIEW = new LatLng(37.4, -122.1);

            private GoogleMap map;

            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
                GooglePlayServicesUtil.isGooglePlayServicesAvailable(getApplicationContext());

                // Obtain the map from a MapFragment (API v2) or MapView (API v1)
                map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();

                map.setMapType(GoogleMap.MAP_TYPE_SATELLITE);
                map.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker"));
                map.setMyLocationEnabled(true);

                // Move the camera instantly to Sydney, Australia with a zoom of 15.
                map.moveCamera(CameraUpdateFactory.newLatLngZoom(SYDNEY, 15));

                // Zoom in, animating the camera.
                map.animateCamera(CameraUpdateFactory.zoomIn());

                // Zoom out to zoom level 10, animating with a duration of 2 seconds.
                map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);

                // Construct a CameraPosition focusing on Mountain View and animate the camera to that position.
                CameraPosition cameraPosition = new CameraPosition.Builder()
                    .target(MOUNTAIN_VIEW)      // Sets the center of the map to Mountain View
                    .zoom(17)                   // Sets the zoom
                    .bearing(90)                // Sets the orientation of the camera to east
                    .tilt(30)                   // Sets the tilt of the camera to 30 degrees
                    .build();                   // Creates a CameraPosition from the builder

                map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
            }

            @Override
            public boolean onCreateOptionsMenu(Menu menu) {
                // Inflate the menu; this adds items to the action bar if it is present.
                getMenuInflater().inflate(R.menu.my_maps_app_apiv2, menu);
                return true;
            }
        }

The following are the LogCat (logs) from launching the MyMapsAppAPIv2.apk app in the Emulator:

    <br>05-03 15:02:22.111: E/Trace(1032): error opening trace file: No such file or directory (2)
    <br>05-03 15:02:22.272: W/ActivityThread(1032): Application com.ccc.mygooglemaps is waiting for the debugger on port 8100...
    <br>05-03 15:02:22.371: I/System.out(1032): Sending WAIT chunk
    <br>05-03 15:02:22.391: I/dalvikvm(1032): Debugger is active
    <br>05-03 15:02:22.581: I/System.out(1032): Debugger has connected
    <br>05-03 15:02:24.252: I/System.out(1032): waiting for debugger to settle...
    <br>05-03 15:02:24.474: I/System.out(1032): debugger has settled (1401)
    <br>05-03 15:02:29.872: E/ActivityThread(1032): Failed to find provider info for com.google.settings
    <br>05-03 15:02:33.012: D/dalvikvm(1032): GC_CONCURRENT freed 142K, 2% free 11769K/11975K, paused 52ms+55ms, total 253ms
    <br>05-03 15:02:34.672: D/libEGL(1032): Emulator without GPU support detected. Fallback to software renderer.
    <br>05-03 15:02:34.682: D/libEGL(1032): loaded /system/lib/egl/libGLES_android.so
    <br>05-03 15:02:34.714: I/Choreographer(1032): Skipped 66 frames!  The application may be doing too much work on its main thread.
    <br>05-03 15:02:34.992: D/gralloc_goldfish(1032): Emulator without GPU emulation detected.
    <br>05-03 15:02:36.132: D/dalvikvm(1032): GC_CONCURRENT freed 231K, 3% free 12049K/12359K, paused 485ms+78ms, total 699ms
    <br>05-03 15:02:36.132: D/dalvikvm(1032): WAIT_FOR_CONCURRENT_GC blocked 175ms
    <br>05-03 15:02:36.352: D/dalvikvm(1032): GC_FOR_ALLOC freed 283K, 6% free 11918K/12551K, paused 131ms, total 134ms
    <br>05-03 15:02:36.492: D/dalvikvm(1032): GC_FOR_ALLOC freed 305K, 6% free 11917K/12551K, paused 39ms, total 63ms
    <br>05-03 15:02:36.652: I/Choreographer(1032): Skipped 67 frames!  The application may be doing too much work on its main thread.
    <br>05-03 15:02:36.944: D/dalvikvm(1032): GC_FOR_ALLOC freed 350K, 5% free 11929K/12551K, paused 119ms, total 146ms
    <br>05-03 15:02:37.384: D/dalvikvm(1032): GC_FOR_ALLOC freed 319K, 5% free 11926K/12551K, paused 167ms, total 186ms
    <br>05-03 15:02:38.072: D/dalvikvm(1032): GC_CONCURRENT freed 343K, 5% free 11998K/12551K, paused 76ms+87ms, total 268ms

AVD (Emulator):

<br>AVD Name:  MyGoogleMaps
<br>Device:  4.65" 720p (720 x 1280:xhdpi)
<br>Target:  Android 4.1.2 - API Level 16
<br>CPU/ABI:  ARM (armeabi-v7a)

If I changed the Emulator's Target from "Android 4.1.2 - API Level 16" to "Google APIs (Google Inc.) - API Level 16" I get a different result and error.

AVD (Emulator):

<br>AVD Name:  MyGoogleMaps
<br>Device:  4.65" 720p (720 x 1280:xhdpi)
<br>Target:  Google APIs (Google Inc.) - API Level 16
<br>CPU/ABI:  ARM (armeabi-v7a)

Logcat

<br>05-03 19:40:59.118: E/Trace(859): error opening trace file: No such file or directory (2)
<br>05-03 19:40:59.188: W/ActivityThread(859): Application com.ccc.mygooglemaps is waiting for the debugger on port 8100...
<br>05-03 19:40:59.208: I/System.out(859): Sending WAIT chunk
<br>05-03 19:40:59.228: I/dalvikvm(859): Debugger is active
<br>05-03 19:40:59.418: I/System.out(859): Debugger has connected
<br>05-03 19:41:01.038: I/System.out(859): waiting for debugger to settle...
<br>05-03 19:41:01.238: I/System.out(859): debugger has settled (1361)
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): Signature not valid.  Found: 
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMw
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): EQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29n
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): bGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEz
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): MzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYw
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): FAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5k
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): cm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtW
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): LgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKke
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): dxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjA
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): sb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/Cx
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): URaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJE
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): qO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/T
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): gt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYD
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIG
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): A1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): 4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/y
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): zKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCE
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): yj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1S
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): KMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifK
<br>05-03 19:41:02.648: W/GooglePlayServicesUtil(859): Z0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3Wf
<br>05-03 19:41:02.828: W/GooglePlayServicesUtil(859): MBEmh/9iFBDAaTCK
<br>05-03 19:41:02.828: W/GooglePlayServicesUtil(859): Google Play services signature invalid.
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): Signature not valid.  Found: 
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMw
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): EQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29n
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): bGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEz
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): MzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYw
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): FAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5k
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): cm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtW
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): LgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKke
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): dxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjA
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): sb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/Cx
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): URaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJE
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): qO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/T
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): gt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYD
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIG
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): A1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): 4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/y
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): zKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCE
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): yj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1S
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): KMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifK
<br>05-03 19:41:02.878: W/GooglePlayServicesUtil(859): Z0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3Wf
<br>05-03 19:41:03.088: D/dalvikvm(859): threadid=1: still suspended after undo (sc=1 dc=1)
<br>05-03 19:41:03.118: D/dalvikvm(859): GC_CONCURRENT freed 290K, 4% free 10907K/11271K, paused 43ms+9ms, total 148ms
<br>05-03 19:41:41.878: D/AndroidRuntime(859): Shutting down VM
<br>05-03 19:41:41.878: W/dalvikvm(859): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
<br>05-03 19:41:41.950: E/AndroidRuntime(859): FATAL EXCEPTION: main
<br>05-03 19:41:41.950: E/AndroidRuntime(859): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.ccc.mygooglemaps/com.ccc.mygooglemaps.MyMapsAppAPIv2Activity}: java.lang.NullPointerException
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.app.ActivityThread.access$600(ActivityThread.java:130)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.os.Handler.dispatchMessage(Handler.java:99)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.os.Looper.loop(Looper.java:137)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.app.ActivityThread.main(ActivityThread.java:4745)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at java.lang.reflect.Method.invokeNative(Native Method)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at java.lang.reflect.Method.invoke(Method.java:511)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at dalvik.system.NativeStart.main(Native Method)
<br>05-03 19:41:41.950: E/AndroidRuntime(859): Caused by: java.lang.NullPointerException
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at com.ccc.mygooglemaps.MyMapsAppAPIv2Activity.onCreate(MyMapsAppAPIv2Activity.java:51)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.app.Activity.performCreate(Activity.java:5008)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
<br>05-03 19:41:41.950: E/AndroidRuntime(859):  ... 11 more
<br>05-03 19:41:51.908: I/Process(859): Sending signal. PID: 859 SIG: 9

I downloaded the following APKs:

com.android.vending.apk
com.google.android.gms.apk

Then I install them into my running (target) emulator with ADB command:

DOS/Console Prompt> adb -e install [path-to-APK-file]

For some reason the maps do not come up or show in the native app. Any ideas!

I did notice that:

Google Maps Android API v1 has been officially deprecated as of December 3rd, 2012. This means that from March 18th, 2013 you will no longer be able to request an API key for this version. No new features will be added to Google Maps Android API v1. However, applications using v1 will continue to work on devices. Existing and new developers are encouraged to use Google Maps Android API v2.

I am not sure if this has something to do with the problem or not.

4

2 回答 2

0

你可以看看我写的关于这个问题的这篇博文:

模拟器加速和谷歌地图

这是我从其中一个帖子中获得的信息。

于 2013-05-05T07:50:09.233 回答
0

我创建了一个(德语)描述如何让它工作:

http://linuxchef.blogspot.de/2013/05/google-maps-api-v2-im-android-emulator.html

您基本上需要一个至少具有 API 级别 9 且没有 Google API 的模拟器。然后,您必须从有根设备中获取 APK:

adb -d 拉 /data/app/com.android.vending-2.apk adb -d 拉 /data/app/com.google.android.gms-2.apk

并将它们安装在模拟器中:

adb -e 安装 com.android.vending-2.apk adb -e 安装 com.google.android.gms-2.apk

如果您的模拟器至少具有 API 级别 14 并另外安装 com.google.android.apps.maps-1.apk,您甚至可以运行本机 Google 地图应用程序

玩得开心。

于 2013-05-08T06:00:12.340 回答