Unable to run Google map in application running in Emulator - android

I am receiving error:
AppName won't run unless you update Google Play services.
Update
Emulator is not showing option for updating Google Play Services.
Configurations
Emulator:
Android 8.1 (Oreo)
Google APIs Intel x86 Atom System Image.
Following is installed:
Build tools 27.0.3
Android Emulator 27.2.0
Google Play Services (Version 48)
Android Studio 3.1 Canary 9 running on Ubuntu.
Tried many solutions on this website but no success.

You Use That Emulator Which have Playstore Like this shown in Image.

Now even better solution exist: using AVD image with build-in Google Play Services. It will enable you to use Google Services including Google Play. Also you will be able update it without re-creating AVD image.
For further information check this post
https://www.google.com.pk/url?sa=t&source=web&rct=j&url=https://stackoverflow.com/questions/14536595/how-to-download-google-play-services-in-an-android-emulator&ved=2ahUKEwjwz76G5u7ZAhUMCuwKHdVFAH4QFjADegQIBxAB&usg=AOvVaw1NNhhmar8bv8PoXT5o9B0q

You must have an Emulator with Google APIs included. Depending in the version of Google Play Services libraries used in your project you may require a higher API level emulator with Google API included.
An emulator with Android 8.0 (API level 26) with Google API (Google Play) included should be enough.
Like this image

Related

Android Emulator stuck on "Google Play Services are Updating"

I recently began learning how to create Google Maps activities in Android app development, and have stumbled onto an issue with Google Play Services. Whenever I set my gradle build dependency to compile 'com.google.android.gms:play-services-maps:11.0.4', which is the most recent version of play-services-maps, the emulator screen gets stuck on the following view upon running my maps app:
I have allowed the app to sit there for over an hour, and nothing has changed or updated. As I've read in other StackOverflow questions, I can get the app to properly function by setting my gradle build dependency to an older version, such as compile 'com.google.android.gms:play-services-maps:9.0.0', but this limits my ability to use newer Android features and APIs in my apps, such as FusedLocationProviderClient.
I am running on Nougat 7.1.1, and have installed the following SDKs in an attempt to solve this Google Play Updating issue:
Android SDK Build-Tools
Android SDK Tools
Google Play APK Expansion Library
Google Play services
Support Repository > Google Repository
I haven't found any StackOverflow threads specific to this "Google Play services are updating" message. What can I do to resolve this issue?
Use API 24 or API 26 Android Emulator system images and you should be good to go. API 25 does not have the latest Google Play Store app pre-installed yet. Note on the screen shot that only these images are "Google Play" versions.
In addition to #Jamal Eason's answer, you may use Nexus 5 and Nexus 5X emulators which have Play Store. Check here. You may also try running on real android device connected via USB that supports google maps and having google play service installed.

Can we run an App with Google Map v2 on Emulator Running Android 4.3?

It is still not clear if we can test Google Map v2 on Android emulator or NOT.
It is all about Play Service and they "Google Android Team" have announced the following:
On Android-Developer Blog
They are saying
To simplify your testing, we've also released an updated Google APIs emulator image that includes Google Play Services 3.2. You can download the image through the Android SDK Manager.
On Android Developer Site They are saying
To test your app when using the Google Play services SDK, you must use either:
•A compatible Android device that runs Android 2.2 or higher and includes Google Play Store.
•The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.
But, I still not able to run the Map on Android Emulator with Google API 18 (4.3).
What is the right answer?
This wasn't possible initially, but it seems the new version of the google play services apk is making it possible.
Check out the answer here here
Unfortunately, I haven't been able to try it out myself.

Install Google Settings on HAXM x86 emulator (Google Maps SDK)

I've gotten a VM accelerated Android emulator (4.2.2, API 17) working using Intel HAXM (on a Mac). I installed the Google Maps SDK using these instructions, which is basically this answer to a previous SO question - Google maps SDK with new Intel Atom x86 emulator - but with pictures.
Therefore, the emulator has access to Google APIs. However, I need to enable location access for Google apps. This is usually done through the Google Settings app, but since the emulator was created targeted to API 17 (not Google APIs 17), Maps and Google Settings are not installed.
Where can I find the .apk for Google Settings in order to install it? It would be even better if there was a way to permanently keep it on the emulator (so that -wipe-data does not delete it).
(I know I need to enable location access because of a problem I was running into earlier. See my previous question here.)
There is now a new x86 system image available which has the Google APIs. Install it from the SDK manager - it's under API 19 and called "Google APIs (x86 System Image)". Using an emulator created from that image you should find you have all the Google APIs you could previously only get on ARM system images (I have only tested Maps v2 so far, but it worked).
As per Google Android Map Api v2 ypu can't run it on an Android Emulator; you need a real device to test your apps. To run a app which uses Google Maps v2 you need two applications already running on the device
1. Google Play Services (com.google.android.gms.apk)
2. Google Play Store (com.android.vending.apk)
Follow this guide here to download and install the latest version of these two apk's using adb commands.

Install Google Plus App on Emulator (Android)

I want to integrate Google Plus Sharing feature in Android Application. But for that, installation of Google Plus App is required.
So I want to include Google Plus App in Emulator. I am using Android 4.2.2 SDK.How can I install it?
I have checked the configuration. But I found problem here by looking at this :
int available = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
Here it says SERVICE_VERSION_UPDATE_REQUIRED. What can I do now for service updation ?
Any help will be appreciated.
Install a compatible version of the Google APIs platform. If you want
to test your app on the emulator, expand the directory for Android
4.2.2 (API 17) or a higher version, select Google APIs, and install it. Then create a new AVD with Google APIs as the platform target.
Note: Only Android 4.2.2 and higher versions of the Google APIs
platform include Google Play services.
You can read more about setting up google play services here
The Google Play Services on those emulators is simply outdated and won't be updated. Use the latest emulator with Google API level 19 (Android 4.4).
More info here: SERVICE_VERSION_UPDATE_REQUIRED and Google play service out of date while integrating Google Plus in android
A physical device to use for developing and testing because Google Play services can only be installed on an emulator with an AVD that runs Google APIs platform based on Android 4.2.2 or higher. For more detail check this

Google play services out of date on a virtual machine

I'm trying to make an application using google maps, but in the emulator it does not work in console I see the following error:
W/GooglePlayServicesUtil(1041): Google Play services out of date. Requires 3159100 but found 3136130
On screen I see that I have to update google services ..
My virtual machine is 4.2.2
What do I do? I've searched the forums here .. but no solution that I've tried has worked ..
Install a compatible version of the Google APIs platform. Open the sdk manager and check if you have the updated Google play services.(assuming you use eclipse)
Quoting from the docs.
If you want to test your app on the emulator, expand the directory for Android 4.2.2 (API 17) or a higher version, select Google APIs, and install it. Then create a new AVD with Google APIs as the platform target.
Note: Only Android 4.2.2 and higher versions of the Google APIs platform include Google Play services.
http://developer.android.com/google/play-services/setup.html
Check the topic under Ensure Devices Have the Google Play services APK.
Make sure you have the latest updates
This is a Google issue. Check this out - https://code.google.com/p/android/issues/detail?id=57880
They've posted a message saying that they will post the updated play services soon. Till then (as of 31 July) you won't be able to run the Google Maps API on your emulator even if you do all the steps required.
Edit: As of September 2013, they've launched an update for it..
In your SDK manager, make sure you've downloaded the latest 'Google play services' or alternatively download them manually and adb install onto the emulator.
I resolved this issue by creating a new avd with target version as : Google APIs(GoogleInc) API Level 18. (platform 4.3 google api required)

Categories

Resources