Running Google Maps v2 on the Android emulator

前端 未结 11 1628
一整个雨季
一整个雨季 2020-11-22 10:32

I\'ve tried to implement Google Maps v2 in my Android application, but unfortunately instead of maps I get this message:

相关标签:
11条回答
  • 2020-11-22 11:07

    For those who have updated to the latest version of google-play-services_lib and/or have this error Google Play services out of date. Requires 3136100 but found 2012110 this newer version of com.google.android.gms.apk (Google Play Services 3.1.36) and com.android.vending.apk (Google Play Store 4.1.6) should work.

    Test with this configuration on Android SDK Tools 22.0.1. Another configuration that targets pure Android, not the Google one, should work too.

    • Device: Galaxy Nexus
    • Target: Android 4.2.2 - API Level 17
    • CPU/ABI: ARM (armeabi-v7a)
    • Checked: Use Host GPU

    ...

    1. Open the AVD
    2. Execute this in the terminal / cmd

      adb -e install com.google.android.gms.apk
      adb -e install com.android.vending.apk
      
    3. Restart the AVD

    4. Have fun coding!!!

    I found this way to be the easiest, cleanest and it works with the newest version of the software, which allow you to get all the bug fixes.

    0 讨论(0)
  • 2020-11-22 11:10

    I've successful installed Google Maps v2 on an emulator using this guide.
    You should do the following steps:

    • Create a new emulator Nexus S, Android 2.3.3. Don't use Google API.
    • Install com.android.vending.apk (Google Play Store, v.3.10.9)
    • Install com.google.android.gms.apk (Google Play Service, v.2.0.12)
    0 讨论(0)
  • 2020-11-22 11:12

    I have successfully run our app, which requires Google Maps API 2, on an AndroVM virtual machine.

    AndroVM does not come with Google Maps or Google Play installed, but provides a modified copy of the Cyanogen Gapps archive, which is a set of the proprietary Google apps installed on most Android devices.

    The instructions, copied from the AndroVM FAQ:

    How can I install Google Apps (including the Market/Play app) ?

    • Download Google Apps : gapps-jb-20121011-androvm.tgz [basically the /system directory from the Cyanogen gapps archive without the GoogleTTS app which crashes on AndroVM]
    • Untar the gapps…tgz file on your host – you’ll have a system directory created
    • Get the management IP address of your AndroVM (“AndroVM Configuration” tool) and do “adb connect x.y.z.t”
    • do “adb root”
    • reconnect with “adn connect x.y.z.t”
    • do “adb remount”
    • do “adb push system/ /system/”

    Your VM will reboot and you should have google apps including Market/Play.

    You won’t have some Google Apps, like Maps, but they can be downloaded from the Market/Play.

    So follow those instructions, then just install Google Maps using Google Play!

    Some great side effects of using a VM rather than the emulator:

    • Vastly superior general performance
    • OpenGL acceleration
    • Google Play support

    The only bump in the road so far has been lack of multi-touch gestures, which is a bummer for a mapping app! I plan to work around this with a hidden UI mechanism, so not such a huge problem.

    0 讨论(0)
  • 2020-11-22 11:15

    I tried the steps above (by paniniluncher) but received the following message:

    Google Play services out of date. Requires 3025100 but found 2012110
    

    I received this message because I required different versions of the files noted above. To resolve the issue I first uninstalled the files referenced above, downloaded the versions that I needed (as referenced in the following StackOverflow posting:

    Google Play services out of date. Requires 3025100 but found 2012110

    and then installed these files using the `adb -e install [path-to-APK-file] and then restarted the emulator and it worked perfectly!

    0 讨论(0)
  • 2020-11-22 11:16

    At the moment, referencing the Google Android Map API v2 you can't run Google Maps v2 on the Android emulator; you must use a device for your tests.

    0 讨论(0)
  • 2020-11-22 11:18

    I am able to have my emulator to run my app with Google Map V.2 (with Google Play Service V.4). I followed steps that others suggested with some failures, however I learned from it and somehow make it work. This is how:

    1. First of all: You must have coded your map app. correctly with all the appropriate permissions setup in your metafile XML, and have Google Play Services APK part of your app. To verify this is true, you must run your app on REAL device and know it works with its map there. Then you can proceed to process your emulator as shown below.

    2. Create a new emulator, or use your existing emulator with specs:

      • Target Name = Android 4.1.2
      • API Level = 16
      • CPU = Any. However, I found ARM is much faster/responsive than x86
      • Have enough RAM memory and space MB
    3. Run you emulator (your target emulator must be running!)

    4. Download the following APKs (available via dropbox per 4/2/2013) to your local directory (scan for virus!):

      • com.android.vending.apk, (Google Play Store, v.3.10.9)

      • com.google.android.gms.apk, (Google Play Service, v.2.0.12)

    5. Install these two APK into your running (target) emulator with ADB command:

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

      NOTE: Possibly, you have had these APKs installed in your emulator during this trial-error, and need to re-install for some reason. You must uninstall them first by: adb -e uninstall (com.google.android.gms or com.android.vending)

    6. Here, it is where things could get tricky. You think you were done, but when you open your app with Map again, but all you get is an error saying something in the form of: "Google Play services out of date. Requires 2012100 but found 2010110", and may see a button to "Update" Google Play. If this is the case, do NOT attempt to click the update button since it won't do anything. I got this error too, and I resolved it by both of these additional steps:

      • Clean-rebuild-reinstall my app into the emulator
      • Shutdown my emulator and re-start it.
    7. That's it, it works now nicely.

    0 讨论(0)
提交回复
热议问题