I am trying to learn about Android Location API using Google Play Services through ANDROIDHIVE but whenever I try to run the app in genymotion the app never starts. I have checked every other apps developed by me they run perfectly and even my location API app runs when I remove the google-play-services-lib from the app through the properties. It only does not run when I add this library . I am using eclipse and the tutorial is also for eclipse users and my genymotion version is 2.4
#Saud kindly double check your set up with your API/s. There are many factors to consider why your app doesn't run. Emulator must run Android 4.2.2 or higher. Check the guide to see if you have followed the steps on setting up the Google Play services to your project. Also, take note that Google Play Services need to be sideloaded in Genymotion.
Related
First of all: I am a Software Testing Engineer, so I don't create applications. I use Android Studio for AVD creation, than I install already developed apk file on Android Emulator and make tests. About a month ago I have noticed an annoying pop-up "Update Google Play services" and when I clicked "Update" button - nothing happened.
I don't want to describe all my struggles, but finally I decided that root cause is the outdated Google Play Services SDK (now I have version 38). Android Studio doesn't offers me to update it, and also I can't find any information about version 39. Maybe you know something about this and can help me?
You can always check here the latest version of Google Play service. This is the official documentation of Google Play service that shows you the update and the highlights of each version. This page also shows you how to use the Google Play services APIs in the Android studio.
Note that to test your app 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.
For the emulator I have below, I am getting the error message that "Google Play Services not installed on the device".
As per the developer site, it says that 'The Android emulator with an AVD that runs the Google APIs platform based on Android 4.2.2 or higher.
Not able to understand if the emulator is running 4.4.2 then why is google play services not present?
Some related threads, but no resolution. (adding these just to point out this issue is not a duplicate):
Related Thread
Related Thread
http://developer.android.com/google/play-services/setup.html
Quoting 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.
Needs Emulator of Google API"S
See the target in the snap
Snap
I prefer testing on a real device which has google play services installed
You will not able to test the app using the Google-Play-Service library in emulator. In order to test that app in emulator you need to install some system framework in your emulator to make it work.
https://stackoverflow.com/a/11213598/1405008
Refer the above answer to install Google play service on your emulator.
If you happen to not have the image, download it via the SDK manager:
If you're using Xamarin, I found a guide on their official forum explaining how to do this:
Download the package from the internet. There are many sources for this, one possible source is the CyanogenMod web site.
Start up the Android Player and unlock it.
Drag and drop the zip file that you downloaded onto the Android Player.
Restart the Android Player.
Hereafter, you might also need to update the Google Play Services from the Google Play Store.
Hope this helps for anyone else who has troubles finding the documentation.
Setp 1 :
Download the following apk files.
1)com.google.android.gms.apk (https://androidfilehost.com/?fid=95916177934534438)
2)com.android.vending-4.4.22.apk (https://androidfilehost.com/?fid=23203820527945795)
Step 2 : Create a new AVD without the google API's
Step 3 : Run the AVD (Start the emulator)
Step 4 : Install the downloaded apks using adb .
1)adb install com.google.android.gms-6.7.76_\(1745988-038\)-6776038-minAPI9.apk
2)adb install com.android.vending-4.4.22.apk
adb come up with android sdks/studio
Step 5 : Create the application in google developer console
Step 6 : Configure the api key in your Androidmanifest.xml and google api version.
Note :
In step1 you need to download the apk based on your Android API level(..18,19,21..) and google play services version (5,5.1,6,6.5......)
This will work 100%.
google play service is just a library to create application but in order to use application that use google play service library , you need to install google play in your emulator.and for that it need the unique device id. and device id is only on the real device not have on emulator. so for testing it , you need real android device.
I'm trying to get the last known location in my Android Emulator from Android Studio by following this tutorial https://developer.android.com/training/location/retrieve-current.html
However, the callback method onConnectionFailed is called with error code: 2. When I show the error dialog in my emulator, it says:
Update Google Play Services
{app_name} won't run unless you update Google Play services.
UPDATE
when I click UPDATE button, I got an error message:
E/SettingsRedirect﹕ Can't redirect to app settings for Google Play services
I think the problem is because Google Play services is not included in the emulator. I tried following the answer here too Android Studio with Google Play Services, but it didn't work.
It says on Google documentation:
To test your app when using the Google Play services SDK, you must use
either:
1.) A compatible Android device that runs Android 2.3 or higher and includes Google Play Store.
2.) The Android emulator with an AVD that runs the Google APIs platform based on >Android 4.2.2 or higher.
Can somebody tell me how to do point 2 ?
My AVD is Nexus 5 API 22 x86
Here's the version chart 4.2.2 means it should API level 17 and up. So your AVD should be fine. Alternatively, you can download Google Play Services APK and install it through ADB shell. See this answer for more information.
However, even if the Play Services issue is solved, you can not get location updates in an emulator since it does not have GPS hardware. You can simulate location behavior through geo command as described here.
Good Noon to all
I'm developing an application which is based on accessing google account for login purpose of my own appplication.
If i run my application means it throws an error as
"Google Play services out of date. Requires 4452000 but found 3136130"
here is my screen shot
I faced the same problem, solution (for Eclipse) was:
remove local copy of google play service from workspace
open Android SDK Manager
delete google play service
install google play service
add local copy of google play service to workspace
Done!
If you search Google play Services in the google play store, you will find an app by google you have to download to get this functionality. If you have any problems, here's the link:
https://play.google.com/store/apps/details?id=com.google.android.gms&hl=nl
I've tried creating new emulators with the normal API levels (tried 17 and 19) and adding the apk from this thread but it doesn't seems to work after the update. I did get it to work though by creating an emulator using the Google API level 19.
To get it to work I think you need to do (assuming Eclipse):
Window->Android SDK Manager and make sure all is up to date.
Update the google play library you've imported to your Workbench
Create a new device (after updating) with Target Google API lvl 19
Then start the emulator and install your app. For me that made the map work. I think your problem is that you've updated the google play library to the newest while you created the emulator before that. Then it doesn't have the version installed you are using in your project.
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.