3

When I click the Google sign-in button, it shows the following dialog.

Enter image description here

I click on Update and nothing happens, but my logcat gives the following output.

01-24 07:38:48.121: W/GooglePlayServicesUtil(1305): Google Play services out of date.  Requires 4132500 but found 4033530
01-24 07:38:50.321: E/SettingsRedirect(1305): Can't redirect to app settings for Google Play services

How can I get this to work on my emulator?

After it failed I ran the following command to see the error and got the following output:

C:\adt-bundle-windows-x86_64-20130729\sdk\platform-tools>adb logcat -d -s Packag
eManager:*
--------- beginning of /dev/log/main
--------- beginning of /dev/log/system
W/PackageManager(  390): Running ENG build: no pre-dexopt!
D/PackageManager(  390): No files in app dir /vendor/app
W/PackageManager(  390): Package com.example.android.apis desires unavailable sh
ared library com.example.will.never.exist; ignoring!
W/PackageManager(  390): Package com.example.android.apis desires unavailable sh
ared library com.example.will.never.exist; ignoring!
I/PackageManager(  390): Time to scan packages: 5.417 seconds
W/PackageManager(  390): Not granting permission android.permission.GLOBAL_SEARC
H to package com.android.quicksearchbox (protectionLevel=18 flags=0x8be45)
W/PackageManager(  390): Unknown permission com.android.smspush.WAPPUSH_MANAGER_
BIND in package com.android.phone
W/PackageManager(  390): Unknown permission com.android.vending.billing.BILLING_
ACCOUNT_SERVICE in package com.google.android.gsf.login
W/PackageManager(  390): Unknown permission com.android.vending.billing.ADD_CRED
IT_CARD in package com.google.android.gsf.login
W/PackageManager(  390): Unknown permission com.android.vending.billing.IBilling
AccountService.BIND2 in package com.google.android.gsf.login
W/PackageManager(  390): Unknown permission com.android.vending.TOS_ACKED in pac
kage com.google.android.gsf.login
W/PackageManager(  390): Unknown permission com.android.chrome.TOS_ACKED in pack
age com.google.android.gsf.login
W/PackageManager(  390): Not granting permission android.permission.ACCESS_DOWNL
OAD_MANAGER to package com.android.browser (protectionLevel=18 flags=0x9be45)
W/PackageManager(  390): Not granting permission android.permission.SEND_DOWNLOA
D_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x9b
e45)
W/PackageManager(  390): Not granting permission android.permission.BIND_APPWIDG
ET to package com.android.widgetpreview (protectionLevel=18 flags=0x8be44)
W/PackageManager(  390): Unknown permission android.permission.INSTALL_DRM in pa
ckage com.android.mms
W/PackageManager(  390): Not granting permission android.permission.DELETE_PACKA
GES to package com.svox.pico (protectionLevel=18 flags=0x8be45)
W/PackageManager(  390): Not granting permission android.permission.DEVICE_POWER
 to package com.android.deskclock (protectionLevel=2 flags=0x48be45)
W/PackageManager(  390): Not granting permission android.permission.READ_DREAM_S
TATE to package com.google.android.gsf (protectionLevel=2 flags=0x40083e45)
I/PackageManager(  390): No secure containers on sdcard
W/PackageManager(  390): Not granting permission android.permission.GLOBAL_SEARC
H to package com.android.quicksearchbox (protectionLevel=18 flags=0x8be45)
W/PackageManager(  390): Unknown permission com.android.smspush.WAPPUSH_MANAGER_
BIND in package com.android.phone
W/PackageManager(  390): Unknown permission com.android.vending.billing.BILLING_
ACCOUNT_SERVICE in package com.google.android.gsf.login
W/PackageManager(  390): Unknown permission com.android.vending.billing.ADD_CRED
IT_CARD in package com.google.android.gsf.login
W/PackageManager(  390): Unknown permission com.android.vending.billing.IBilling
AccountService.BIND2 in package com.google.android.gsf.login
W/PackageManager(  390): Unknown permission com.android.vending.TOS_ACKED in pac
kage com.google.android.gsf.login
W/PackageManager(  390): Unknown permission com.android.chrome.TOS_ACKED in pack
age com.google.android.gsf.login
W/PackageManager(  390): Not granting permission android.permission.ACCESS_DOWNL
OAD_MANAGER to package com.android.browser (protectionLevel=18 flags=0x9be45)
W/PackageManager(  390): Not granting permission android.permission.SEND_DOWNLOA
D_COMPLETED_INTENTS to package com.android.browser (protectionLevel=2 flags=0x9b
e45)
W/PackageManager(  390): Not granting permission android.permission.BIND_APPWIDG
ET to package com.android.widgetpreview (protectionLevel=18 flags=0x8be44)
W/PackageManager(  390): Unknown permission android.permission.INSTALL_DRM in pa
ckage com.android.mms
W/PackageManager(  390): Not granting permission android.permission.DELETE_PACKA
GES to package com.svox.pico (protectionLevel=18 flags=0x8be45)
W/PackageManager(  390): Not granting permission android.permission.DEVICE_POWER
 to package com.android.deskclock (protectionLevel=2 flags=0x48be45)
W/PackageManager(  390): Not granting permission android.permission.READ_DREAM_S
TATE to package com.google.android.gsf (protectionLevel=2 flags=0x40083e45)
I/PackageManager(  390):   Action: "android.intent.action.SENDTO"
I/PackageManager(  390):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  390):   Scheme: "sms"
I/PackageManager(  390): Adding preferred activity ComponentInfo{com.android.mms
/com.android.mms.ui.ComposeMessageActivity} for user 0 :
I/PackageManager(  390):   Action: "android.intent.action.SENDTO"
I/PackageManager(  390):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  390):   Scheme: "smsto"
I/PackageManager(  390): Adding preferred activity ComponentInfo{com.android.mms
/com.android.mms.ui.ComposeMessageActivity} for user 0 :
I/PackageManager(  390):   Action: "android.intent.action.SENDTO"
I/PackageManager(  390):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  390):   Scheme: "mms"
I/PackageManager(  390): Adding preferred activity ComponentInfo{com.android.mms
/com.android.mms.ui.ComposeMessageActivity} for user 0 :
I/PackageManager(  390):   Action: "android.intent.action.SENDTO"
I/PackageManager(  390):   Category: "android.intent.category.DEFAULT"
I/PackageManager(  390):   Scheme: "mmsto"
I/PackageManager(  390): Adding preferred activity ComponentInfo{com.android.mms
/com.android.mms.ui.ComposeMessageActivity} for user 0 :
W/PackageManager(  390): Attempt to delete unknown system package com.android.ve
nding
W/PackageManager(  390): Attempt to delete unknown system package com.android.ve
nding
W/PackageManager(  390): Attempt to delete unknown system package com.google.and
roid.gms

C:\adt-bundle-windows-x86_64-20130729\sdk\platform-tools>

What am I supposed to make of this?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ogen
  • 6,499
  • 7
  • 58
  • 124

2 Answers2

2

The emulator does not support the Google Play Services. That is why it's throwing an error. To develop using the APIs, you need to provide a development device such as an Android phone or tablet.

Google Play services out of date.Requires 4132500 but found 4033530

To get the play services in your emulator, you have to install the APK file on your own.

Here are the APK gms and vending files.

Install both the APK files using the below command.

adb install com.android.vending-20130716.apk 
adb install com.google.android.gms-20130716.apk 

And if it's already installed then to upgrade an existing emulator, you need to uninstall the previous versions using the below command and then install it again:

adb uninstall com.android.vending
adb uninstall com.google.android.gms
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
GrIsHu
  • 29,068
  • 10
  • 64
  • 102
  • WHere do I save the apk files? – Ogen Jan 24 '14 at 13:21
  • copy that in your `android-sdk/platform-tools` folder and install it using the commands which i have specified in my answer. – GrIsHu Jan 24 '14 at 13:35
  • They were already installed so I went to uninstall them by using your last commands but it just says **Failure**, thats all. – Ogen Jan 24 '14 at 13:47
  • I checked the error message with adb logcat -d -s PackageManager:*, please see my edit. I appreciate your help :) – Ogen Jan 24 '14 at 13:59
  • @Clay Its saying that you do not have permission to uninstall playstore application. I suggest you to just install the apk again and it will override to the old one. – GrIsHu Jan 25 '14 at 04:05
  • Yeah I want to install the apk again but it says they're already installed so I have to uninstall them but then I get the error message saying I dont have permission. So how am I supposed to install it? – Ogen Jan 25 '14 at 05:36
1

I found the solution on the page How to install Google Maps v2 in Android Emulator.

It only works with Android 4.22, but I think that the same idea can be applied to version 4.4 with the appropriate files.

  1. Download the three files listed on the previous page: com.android.vending-19032013.apk, com.google.android.gms-19032013.apk and Google play services lib r5.

  2. Create an AVD device with a normal target (Android 4.22, API 17), with Intel Atom (x86) if you want to use.

  3. Install the two APK files from Android console.

  4. Create your app for Android 4.22

  5. DO NOT USE the google-play-services-lib of your system. You must use the third downloaded file.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131