LoginSignup
2
0

More than 1 year has passed since last update.

FlutterでAndroidEmulatorに won't run without Google Play services と表示されGoogleMapが表示できない

Posted at

■前提

Flutterの開発中、AndroidEmulator上に地図を出したいと思い、
GoogleMapを表示するサンプルを試しました。
https://codelabs.developers.google.com/codelabs/google-maps-in-flutter#0

Android用のキーを取得して、AndroidManifestに設定しと進めていったところ、
無事実機ではGoogleMapが表示されることを確認。

ところがEmulator上で表示しようとしたところ、
googlemap_sample won't run without Google Play services,
which are not supported by your device.
と表示され地図が出ません。

AndroidStudioのログには
W/GooglePlayServicesUtil( 3773): Google Play Store is missing.
W/Gralloc4( 3773): allocator 3.x is not supported
というような怪しいログも出ています。

・環境

・OS
macOS Big Sur バージョン11.5.2
64bit

・実機
Pixel 55
Android 11

・エミュレータ
Pixel 5 API 30

・IDE
Android Studio Arctic Fox | 2020.3.1

■解決方法

  • 64bit用のSystemImage(Google APIs Intel x86 Atom_64 System Image)をインストールする

スクリーンショット 2021-09-01 11.15.16.png

  • AVDマネージャーからAVDを編集、SystemImageを64bit向けのものに変更

スクリーンショット 2021-09-01 11.16.02.png

スクリーンショット 2021-09-01 11.16.31.png

この状態で起動すればGoogleMapが起動します。

VirtualDeviceを追加するときに、SystemImageを選択する箇所があるのですが、
ここのRecommended(お勧め)がx86(32bit)なんですよね。
これをそのまま選択するとハマってしまう罠となっています。

大事なのは AVDのSystemImageを64bit向けのものに変更 することです。
インストールしても設定しないと意味がない ので注意してください。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0