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

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.

Related

How to resolve Google Play Services library dependency with minimum required version

I am trying to include a SMS feature from Google play services support libraries to improve the authentication process. The documentation around it recommends using atleast minimum of 10.2 play services in order to use it.
Prerequisites:
The SMS Retriever API is available only on Android devices with Play services version 10.2 and newer.
However, when I go to build my project specifying the 10.2.0 version of in gradle, Android studio tells me it is unable to resolve this dependency from either jcenter or google's repos.
compile 'com.google.android.gms:play-services-auth-api-phone:10.2.0'
Error:org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.google.android.gms:play-services-auth-api-phone:10.2.0.
I tried searching for the package, but couldn't find that version: google's maven repos only show 11.0 and above.
It would be really helpful if someone could point me to the minimum available version of play services libraries over 10.2 that can be used to make this work.
Versions of Google Play services prior to 11.0.0 are only available through the SDK Manager. Make sure you have installed the Google Play services item in the SDK Tools tab of the SDK Manager.
However, in the case of the SmsReceiverClient API, that class was only added in Google Play services 11.0.0 SDK. It may be that the underlying implementation did exist back to 10.2, but was not public.
In any case, Google Play services releases an SDK only after it is made available to all users and will automatically update the vast majority (99.5%+) of users within the first week or two of availability. Given that 11.0.0 has been available for over 6 months, it should not be any issue in relying on the 11.0.0 library.

Android Device 4.4.4 Google Play Services

I am developing an Android app and want to support back to API version 15.
The device I'm running has Android version 4.4.4
Google Play service is install on the device with version 4.4.52
What dependency do I need to add to my gradle? I've tried a bunch but haven't had luck:
Example:
1)
compile 'com.google.android.gms:play-services-location:6.+'
This compiles however it fails on run saying play services needs an update.
2)
compile 'com.google.android.gms:play-services-location:4.4.52'
This doesn't compile and I get the following error that I'm unsure how to fix.
google play services 4.4.52 attribute "theme" has already been defined
Here is a list of my entire Gradle dependencies:
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'org.parceler:parceler:0.2.13'
compile 'com.jpardogo.materialtabstrip:library:1.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.android.gms:play-services-location:6.+'
You should use: com.google.android.gms:play-services-location:7.5.0.
To get the following info: Google Location, Activity Recognition, and Places.
GooglePlay Service is compatible to Android device that runs Android 2.3 or higher and includes Google Play Store.
All info about GooglePlay Service SDK, you can look at: https://developers.google.com/android/guides/setup

Android Google Play Service on Emulator - Not working

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.

Google Play services - version issue

I am targeting Android > 19. The latest Google Play services version is 5.2.08, but on my device the latest I can install is 4.4.52.
Now, when I check for GooglePlayServicesUtil.isGooglePlayServicesAvailable() I always get that my version needs to be updated and I am redirected to the store. But I cannot update from strore, because the latest version is not supported on my device (I see only open and uninstall buttons).
What is the solution for this? I need only notifications feature, nothing more. Should I use older version of Play Services? How can I know which version to choose? Where to get the official older version?
Thanks
If you use Android Studio, just replace in build.gradle :
compile 'com.google.android.gms:play-services:+'
by
compile 'com.google.android.gms:play-services:5.0.89+'
or lower
You should have something like this in your build.gradle:
compile 'com.google.android.gms:play-services:5.0.+'
Try changing it to something like this:
compile 'com.google.android.gms:play-services:4.4.+'

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