Android emulator with google play services - android

I created an android emulator to test google play services, with the google apis 4.2.2 or greater like this article said
https://developers.google.com/android/guides/setup, but only google maps services is available, and the game I am testing claims for google play services. I am missing something?

You can refer google play services in 4.2.2 emulator
And I will suggest you to use Genymotion instead of using android default emulator. It is like virtual phone and you can also add Gapps in it as well as download any app from Google Play, same as android device.
Genymotion and you can download google apps based on your virtual device version from this Genymotion Gapps link

You have to run an emulator with Target: Google API´s
Also be sure of compile this:
compile 'com.google.android.gms:play-services:8.3.0'
(Lastest version of google play services) If it doens't run, check for the verion of google play services on the emulator and change the version to compile.

Start SDK Manager. Check APIs in android version you create emulator and install it. Open SDK folder/system-images and delete the emulator image. Start Emulator Manager and dowload new image with api. Start new emulator and it fixed.

Related

How to update Google Play Services on the emulator in Android Studio

Hi I am trying to run an Android Program I have created that can connect to Firebase with Authentication using email and password but it seems that I cannot even authenticate due to the fact of them saying my Google Play Service is not up to date.
I am stump here as I have the latest google play services according to my SDK manager
and I don't think it is my code's problem as when I use my friend's phone for debugging it works but not when I am using the emulator.
How can I update my google play services in the Android Studio built-in emulator.
Since Google introduced Google Play Store images in Android SDK Tools 26.0.0 now emulators comes with installed Google Play Store.
When creating Emulator use images that support Google Playstore (currently Nexus 5 and Nexus 5x with android O)
From 26.0.3
Adds a new tab in the extended window for Google Play Store images that displays the Play Services version and a button to check for updates to Play Services.
Edit:
Make sure that you use emulator with playstore is installed. Check if you have sdk manager -> sdk platforms -> Android 8 -> Google Play ... system image installed. Download it. Create new emulator using that image.
I had the same issue and spent half a day working it out.
In your emulator, go to settings->apps->Google Play Services and compare the version used to what appears in your build.gradle file.
In my case the emulator was running an earlier version and no amount of updates seemed to change it.
In build.gradle, I changed the following:
compile 'com.google.android.gms:play-services:9.6.1'
to
compile 'com.google.android.gms:play-services:8.+'
After which I restarted android-studio and it worked flawlessly.
I was facing same issue, but i downgrade my play services version in build.gradle.
settings->apps->Google Play Services application check image
my google play services version is 10.2.98, that's why we need google-play-services(in module level build.gradle) version lower than our emulator's library version.
set the lower version from here, we can see 10.2.6 is better and set it in build.gradle like this
compile 'com.google.android.gms:play-services-places:10.2.6'
and just simple, run app again.
Try to download and install the latest APK for Play Services as stated in this thread.
Based from Google documentation,
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.
Try to navigate to settings--> apps in your emulator and then find Google Play Services. Check the version number and use it in you build.gradle. To update it with the latest version, you can see it in these documentation and SO question.
Be noted that updates might not reach all users immediately, so your app should verify the version available before attempting to perform API transactions.

Android Studio : Get Google Play Services

I want to use Google Maps in my app
But when I run my app I get this error
This app won't run without Google Play services, which are missing from your phone. GET GOOGLE PLAY SERVICES
I tried other solutions like installing the google api from SDK Manager but did not work, and still get the same error.
Anyone can help me?
In order to run application that uses Google Play Services, your emulator or device must have Google Play Services installed.
In Android SDK Manager allows you to install emulator system images with preinstalled Google Play Services.
When you have those installed on your system, you can then create emulator that will be able to run your application.
Open AVD Manager and create new emulator. Make sure that you use some of Google API system images.
it looks like your device/emulator don't have gapps isntalled.
Google Play Services is coming with Google apps (called gapps). A great tutorial can be found here : http://forum.xda-developers.com/showthread.php?t=2528952
By the way, use CM11 gapps link.

run google play store on android emulator

I installed Google play store on my android emulator successfully. But when I try to run Google app it gives "Unfortunately, Google services framework has stopped" error message. I tried to fix it using clear cache of Google play store app, clear data of Google services framework app and restart the device. Also I tried for new emulators. But It didn't work. Does it a matter version of android sdk and Google Services Framework.apk version?
Suggest a way to fix this problem.
Read up on the guide provided by Android here.
Specifically, note:
To test your app when using the Google Play services SDK, you must use
either:
A compatible Android device that runs Android 2.3 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.
As long as you satisfy those requirements, follow the installation instructions provided to install the SDK into your Developer environment.

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.

"This app won't run unless you update google play services" alert

I am getting "Update Google Play Services" alert when running project on emulator. If I click OK then there is one more alert behind it. I keep clicking OK and there are tons of alerts already popped up and I end up giving up.
Message looks as below :
I've tried updating everything in SDK manager. Also tried in Eclipse, Help->Check for updates.
Updated: Jun 27 2019:
The new google x86 emulator with play services is exactly like a device where you can install apps from play store and all other things.
Previous Answer:
I faced similar problem while trying google maps in emulator. While some people have been able to run google play services in their emulator by downloading google play services application from their mobile, making the apk file and then installing that file in emulator, it is really complicated process and works for certain api level only. Same is the case with emulator using google api's that shift with builtin maps and google play services. The maps application will work in emulator while your application asks for update to google play services. So the wise thing to do is to test it in real hardware.
For me, I had to go to settings | apps on my emulator and then find Google Play Services, I then saw that the version number was no where near the current version number (6.7.74 as against the current 7.3.0)
I then went to my dependencies and changed:
compile 'com.google.android.gms:play-services:7.3.0'
to
compile 'com.google.android.gms:play-services:6.+'
You'll get warnings saying a newer version is available and to avoid using + in version numbers but if you've spent the entire day looking for a solution like I did, you could care less.
In android studio changing the depencies work for me:
com.google.android.gms:play-services:5.+
to:
com.google.android.gms:play-services:5.0.+
Now you can also use your emulator to run Android MAP API V2.
Note: Only Android 4.2.2 and higher versions of the Google APIs platform include Google Play services.
The problem here is that you have an older version of Google Play Services. Update to the latest version by opening the SDK Manager => Extras => Google Play Services.
you can try using new Genymotion Android emulator in which you can update google play services. I have faced this alert and able to update it.
It seems like we can't test latest Google maps API, which is dependant on google play store app which is missing in Google's Android Emulator.
Genymotion Android Emulator comes with Google Play store app.
NOTE: Genymotion v2.0 discontinued packaging virtual machine with google apps , but refer this link to add Google Apps Manually to Genymotion
I had the same issue.
It's nice that in the newer emulators (for version 17 and up) come with the play services included, but what about older versions?
eventually i found the emulators provided by testobject. all their emulators (starting at version 15) come with the updated play services and google APIs (maps v2 etc'), for both ARM and x86.
Check this answer https://stackoverflow.com/a/19734573/3284964. It helped me. For me it works on 4.3 emulator (google play services release 3.2.65) and google play services for froyo lib in my app.
I had a problem with Android Studio when it imported my Eclipse project.
Look for Google Play Services in your build.gradle.
dependencies {
compile 'com.google.android.gms:play-services:+'
}
Change this to use an exact version:
dependencies {
compile 'com.google.android.gms:play-services:5.0+'
}
Then clean build (Build -> Clean Project).
Just did some checking and I realise this question is quite old but, it seems API19 Google Apis Disk Image works with Google Play Services just tested it with an application im working on and it shows the Goolge Maps V2 just fine.
(Only for Android Studio Users)
I have faced the same problem and solved it by updating Android Studio and SDK libraries.

Categories

Resources