Android Google Play Service on Emulator - Not working - android

I tried to use the Google Play Service to display location address and write code according to the official guide (https://developer.android.com/training/location/display-address.html), but it doesn't work on the emulator. So I downloaded and tried the example code on Github (https://github.com/googlesamples/android-play-location/tree/master/LocationAddress), and still found it not working.
I use the emulator: Jelly Bean Google APIs (Google Inc.).armeabi-v7a
Following some solutions on Stackoverflow, I downloaded the Google APIs SDK and Google Play Service SDK with SDK manager, but not working.
Here's the dependency code:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:7.0.0'
}

To develop an app using the Google Play services APIs, you need to set up your project with the Google Play services SDK.
If you haven't installed the Google Play services SDK yet, go get it now by following the guide to Adding SDK Packages.
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.

Related

Does 'Maps SDK for Android v.3.0.0 BETA' work on devices without Google Play Services?

Does 'Maps SDK for Android v.3.0.0 BETA' work on devices without Google Play Services?
From the doc:
Version 3.0.0 beta of the Maps SDK for Android is a new implementation with the same API surface as the previous version (...). The main areas of change are as follows:
The Maps SDK for Android is now distributed via a standalone static library. Previously, the Maps SDK for Android was made available as part of Google Play services.
I have followed the guide and run these new maps on an emulator without Google Play Services. The app opens fine but the map view doesn't display the map of an area. Instead, the map view shows the following text: This app won't run without the Google Play services.
My take is that this static library won't work on devices without the Google Play Services (e.g: Amazon Fire tablets, newest Huawei phones, etc)
No, version 3.0.0 beta of the Maps SDK for Android does not work on devices without Google Play Services.
While it does not use com.google.android.gms:play-services-maps:17.0.0, it does use the following Google Play Services dependencies:
implementation 'com.google.android.gms:play-services-basement:17.2.1'
implementation 'com.google.android.gms:play-services-base:17.2.1'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
For now and the foreseeable future, the Google Play Services remain a mandatory dependency of the Maps SDK for Android, the 3.0.0 BETA included. In general, Google SDKs and software on Android depend by design on the Play Services.

Android GCM-App won't run unless you update Google Play Services

I am using GCM Push Notification Code in my Android Project. While running on real Devices, every times it ask me to Update Google Play Services.
I am using the following version for GCM library:
dependencies {
compile 'com.google.android.gms:play-services-gcm:8.3.0'
compile 'com.android.support:support-v4:19.1.0'
}
I am using the same code from Android quickStart Sample:
Sample Code Link
I am targeting my App for 5.0 and above Devices. Is there any way, so that I can switch to lowest library version of GCM that majority of Android 5.0 comes with.
So that I need to install updated version of Google Play Services while running my App.
Always compile your project with the latest version which support libraries. They run on all version previous versions of Android.
All Android 2.3, 4.x, 5.x, 6.x version run the same latest version of the latest support libraries.
Current latest version of support libraries are
dependencies {
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.android.support:support-v4:23.1.1'
}
The whole point of providing Play Services and Support libraries is that Google can update following libraries on all phones without updating the core Android OS.
If you get message on your phone that you need to update Play Services then please do so. Without having the latest version of Play Services many apps will have problems to run.

AVD Error - Update Google Play Services

I'm trying to incorporate GCM into my Android app
I've got compile 'com.google.android.gms:play-services:8.3.0'
in my app level build.gradle
I've got classpath 'com.google.gms:google-services:1.5.0'
in my project level build.gradle
My AVD is API23, Target Google APIs.
My Project Structure's Compile SDK version is Google APIS API 23.
From within the AVD i can see the installed Google Play services is v 8.1.85.
So I thought this might be the problem
However I can't install a new apk via 'adb install *.apk' as I'm informed INSTALL_FAILED_UPDATE_INCOMPATIBLE
I have Google Play Services, rev 28 installed in my SDK settings
I'm a beginner on Android so I'm presuming I've overlooked something fundamental!
Unless Google won't update the virtual devices with the new Google Play Services you have to use Genymotion with Google apps.
How to install Google apps in Genymotion: How do you install Google frameworks (Play, Accounts, etc.) on a Genymotion virtual device?

Android google map not visible on emulator due to google service update issue

I am creating a google map application and I want to view my output on an emulator and I am developing using android studio version (beta)0.8.6. I have updated my sdk and installed all the necessary packages including google play services, google play repository and google apis for jelly beans 4.4.2 api level 17. But then again it shows :" This app wont run unless you update google play services".
this is my build .gradle:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:20.+'
compile 'com.google.android.gms:play-services:5.2.08'
}
and it shows me this message in logcat:
Assertion failed: for not generated items old indentation must be defined: element PsiElement(new line)
Please help me I am stuck on it for days.
I also had a lot of trouble with that.
Look in your device or emulator and see which version of Google Play Services you are using. I had version 5.0.89 on all my devices.
If you don't have Google Play Services, install the google apps (gapps) on your emulator or use a real device.
try changing this line
compile 'com.google.android.gms:play-services:5.2.08'
to
compile 'com.google.android.gms:play-services:5.0.89'
That helped for me.
(for some reason my build.gradle changed 5.0.89 to 5.2.08 again and it still works...)
related question with possible answers: play services update required
Here is another example where it worked: After update - crash com.google.android.gms:play-services:5.2.8

Google Play services complains to be out dated

And it's aparently not.
I've just compiled an APP with the latest google play services, which I've set on gradle as:
compile 'com.google.android.gms:play-services:+'
But when I open my APP, there's a huge warning.
And in LogCat:
W/GooglePlayServicesUtil﹕ Google Play services out of date. Requires 5208000 but found 5089070
If I open google play (pressing Actualizar button), I can see my Google Play services are totally updated.
This is happening on a genymotion emulator aswell as on a nexus 5 device.
I've tried things like:
compile 'com.google.android.gms:play-services:5.2.8'
However it complains:
Error:Could not find com.google.android.gms:play-services:5.2.8.
Required by:
:mobile:unspecified > :BaseGameUtils:unspecified
Any tips?
Fixed with
compile 'com.google.android.gms:play-services:5.0.89'
I've found out is that my Android Studio is downloading some version of google play services, which is not yet released on Google Play. That means that noone have that latest APK on their devices. So setting gradle to use an older version, will make the trick
Fixed with
For Gradle:
compile 'com.google.android.gms:play-services:5.0.77'
For Eclipse:
Add as library: https://dl-ssl.google.com/android/repository/google_play_services_5077000_r18.zip
If above did not work, try to use older playstore service version of android playstore client.
https://dl-ssl.google.com/android/repository/google_play_services_4132530_r14.zip
https://dl-ssl.google.com/android/repository/google_play_services_4242030_r15.zip
https://dl-ssl.google.com/android/repository/google_play_services_4323030_r16.zip
https://dl-ssl.google.com/android/repository/google_play_services_5077000_r18.zip
https://dl-ssl.google.com/android/repository/google_play_services_5089000_r19.zip
https://dl-ssl.google.com/android/repository/google_play_services_6171000_r21.zip

Categories

Resources