エミュレータでGoogle Maps for Android V2を動かす方法

前回、AndroidアプリでGoogle Mapsを使う方法→エミュレータ派死亡でGoogle Maps for Android V2をエミュレータで動かそうとしたところ、エラーが出て動きませんでした。

ネットで調べても、無理っぽいということで一旦あきらめたんですが、
ちょこっとネットを調べていたら、解決方法らしきものを見つけました。

ということで、今回はその解決法が本当に動くのか試してみます。

[ad#336×280]

AndroidでGoogle Maps v2 をエミュレータで動かしてしかも爆速
How to make Android Google Maps v2 work in android emulator

まずはAVD Managerでエミュレータを作る。
5.1インチを選択。
targetはAndroid 4.1.2 API level 16を選択。
CPU/ABIはARMを選択。
あとはデフォルトのまま起動する。

次。

com.android.vending-1.apk
com.google.android.gms-1.apk
上記の2つをADB install commandでインストールする。

『インストールコマンドは”adb -s {DEVICE NAME} install {APK}”』
『Device名は”adb devices”で調べる』

とりあえずadb devicesってターミナルに打ってみるが無反応。

そもそもadbって何って調べたところ、

adbはAndroid Debug Bridgeといって、
sdk/platform-tools/adbにありました。

adbの場所までターミナルでいって、
./adb devices と打つと、
List of devices attached
空っぽ。

ちがうエミュレータ(Android2.3.3)を動かしてみる。
./adb devices
List of devices attached
emulator-5554 device

あれ、出てきた。
再度、新しいAVDを起動して。。
./adb devices
List of devices attached
emulator-5554 device

あ、表示されるようになった。
とにかく、デバイスの名前はemulator-5554。

インストールの方法は、
./adb -s emulator-5554 install /Users/kyosuke/Downloads/com.android.vending-1.apk
./adb -s emulator-5554 install /Users/kyosuke/Downloads/com.google.android.gms-1.apk

Successって出てきた。

MapsV2のサンプルを動かしてみる・・・

エラーが起きた。。。けど、サンプルプログラムがダメな感じ。

Google Maps Android API v2の使い方を参考に(主にコピペ)、サンプルプログラムを書き直して再度実行!

This app won’t run unless you update Google Play services.

LogCatには、
Requires 2012100 but found 20101
って表示されてる。

うーん、お仲間いないかなと探したところ

How to make Android Google Maps v2 work in android emulator

Q.
Thanks a lot but this solution no longer works
Google just set an update for Google Play services on the SDK Manager (Rev. 4) that causes a warning: “Google Play services out of date. Requires 2012100 but found 2010110″ and the aplication shows again the blank screen telling you to update Google Play services =S

A.
I don’t know how to fix that, I would recommend searching the web for an apk with required version

ぎゃー、無理だって。

Google Play servicesのバージョンを最近あげたらしく、
Google Play servicesの新しいバージョンのapkをネットから探してくるしかないらしい。

しばらくして・・・

うわーー、動いたー!!!!

danbroughさん素敵!!

This app won’t run unless you update Google Play Services. (via Bazaar)

Ok, if you have play services 4th revision, look at the @danbrough answer, and download apks specified in the comment: link – Ilja S.

Here are the files I used: vending.apk and gms.apk – danbrough

もう一度、新しいAVDを作って起動します。
platform: 4.1.2, Api Level: 16, CPU Intel/Atom x86)

vending.apk
gms.apk

上の新しいapkを落としてきて、インストールします。

Google Maps Android API v2の使い方に載っているGoogle Maps V2のサンプルアプリを実行すると、、

この方法で、ついにエミュレータでGoogle Mpas V2が表示されました!

コメントを残す

メールアドレスが公開されることはありません。

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください