GooglePlayServices is not working with the project - android

I am working on a project where I have to authenticate a user with the Google plus and I did that. Now I have shifted my project from one PC to another for some reasons. I have made changes on developers console but when I try to login with google plus after launching, it says "Google Play Services not available. This application will close."
Why this error comes when everything is fine?
gradle dependencies is as follows:
dependencies {
compile 'com.android.support:support-v4:+'
compile 'com.google.code.gson:gson:1.7'
compile 'com.google.android.gms:play-services:+'
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true;
}

Make sure that the device (or the emulator) where you're running the app has Google Play Services installed with the latest version (currently at least 8.1.0), or set exact (earlier) version in your build.gradle.

Related

Blank white screen on android using react-native (release only)

My app is running fine on the emulator in debug mode. When I tried to use a signed APK on a device or run it in release mode on the emulator using:
react-native run-android --variant=release
It just gives a blank white screen and does not load.
I am using React-Native-Navigation and React-Native-Firebase, which may or may not be contributing to the issue.
One error I do see is related to Firebase I think:
W/GooglePlayServicesUtil: Google Play services out of date. Requires
11717000 but found 10298470 11-20 11:24:04.624 16106-16106/? W/FA:
That failed to send app launch certainly looks ominous.
EDIT: I am not so sure the above error is actually causing the blank white screen when running release version on my device. This message shows up in the emulator, but my app works on the emulator. On my device I see that the version of Google Play Services is 11.7.46 which I believe should work fine.
Is there anything else that would cause my app to be a blank white screen on release only?
EDIT 2:
i found another error this time (and I have since downgraded to an older version of react-native-firebase 2.2)
11-25 12:11:07.278 5281-5295/com.spectrum E/FirebaseCrash: Failed to load crash reporting
com.google.android.gms.internal.mn: .com.google.android.gms.dynamite.DynamiteModule$zzc: Remote load failed. No local fallback found.
at com.google.android.gms.internal.ml.zzFk(Unknown Source)
at com.google.firebase.crash.zzc.zzFi(Unknown Source)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: com.google.android.gms.dynamite.DynamiteModule$zzc: Remote load failed. No local fallback found.
...
EDIT 3:
here are the dependencies from app.gradle :
dependencies {
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:25.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-navigation')
// RNFirebase required dependencies
compile(project(':react-native-firebase')) {
transitive = false
}
compile "com.google.firebase:firebase-core:11.0.4"
// RNFirebase optional dependencies
compile "com.google.firebase:firebase-crash:11.0.4"
compile "com.google.firebase:firebase-messaging:11.0.4"
// If you are receiving Google Play API availability issues, add the following dependency
// compile "com.google.android.gms:play-services-base:11.0.4"
}
As the error says:
Google Play services out of date. Requires 11717000 but found 10298470
It means you have a different version of google play services. Im gonna assume you are using the latest firebase which is Firebase 11.6.0, but you are using Google Play Services version 10.2.9, and the version required is 11.7.1.
From the Firebase docs(in the prerequisites):
A device running Android 4.0 (Ice Cream Sandwich) or newer, and Google Play services 11.6.0 or higher
So, you either need to download the latest version of Google Play Services, or downgrade firebase in your build.gradle file
You currently have this version of firebase:
'com.google.firebase:firebase-core:11.6.0'
downgrade(maybe) to:
'com.google.firebase:firebase-core:10.2.0'
if you downgrade the firebase-core, then you have to also downgrade(in build.gradle) firebase-auth/firebase-storage/firebase-database
As you see the log, Google Play services out of date. Requires 11717000 but found 10298470, it shows that this error comes with older play service.
The Current version is 11.6.0, so you need to update build.gradle file and sync.
'com.google.firebase:firebase-core:11.6.0'

Google Play Services Dependency

When I open my app, it is supposed to take me to the login page for Google or email. It runs me to the main screen and says update Google Play Services. I am not sure why this is happening when I am running the latest version -
compile 'com.google.android.gms:play-services-auth:11.0.0'
I switched to just the auth in order to avoid transitive dependency issues. It was not working with the regular gps dependency.
It isn't my code because I have been doing a tutorial..I've checked.
My project builds, but I would like the services to work :-)
In your project level build.gradle add
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
}

What is the best way to add Google Play Service dependencies on Android Studio?

I have added Google Play Service dependencies to Android Studio.
I want something that works today and in the near future, something that keeps my app code up to date, without having to worry about every new Play service release, if possible.
Currently, I have this:
dependencies {
compile 'com.google.android.gms:play-services:7.5.0'
}
Is this the best way to add Google Play Service dependencies on Android?
You can use the following to always build against the latest available Google Play Services version:
compile 'com.google.android.gms:play-services:+'
However you will get a warning from Android Studio indicating that your builds are potentially non-repeatable and your code may break at any time (and you may not know why) due to changing versions behind the scenes. It's a trade-off. For a little more control you can use one of these:
compile 'com.google.android.gms:play-services:7.+'
compile 'com.google.android.gms:play-services:7.5.+'

Too new android google play version

I have created an android application using Android Studio. I have this code in the manifest file:
<meta-data android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
and the value for #integer/google_play_services_version is 520800 (value added automatically when I linked the Google play library. No hardcode there).
This is the link between the library and the project
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.google.android.gms:play-services:+'
}
also auto generated when I have added the Google play library from the menu.
The application works fine, bun when I generate a signed APK and try to upload it to the Google market it gives me an error saying that I am trying to upload an APK which uses google play version 5208000 and I should use version 5100000 or lower.
I have tryed to google_play_services_version into 5100000 but then the application stops working from the beginning.
How should I make my app runnable and valid for uploading on the market?
The problem is with this instruction:
compile 'com.google.android.gms:play-services:+'
the play-services:+ means that it will pack the very latest play-services version. The problem is that the very latest play-services version available on the development environment is not yet fully published worldwide by Google, therefore not yet available to be used in official builds. So you have to use a version that it is indicating or lower..like this one: play-services:5.0.89.
So this one will work:
compile 'com.google.android.gms:play-services:5.0.89'
To find a list of available version, take a look at this folder in your SDK: extras/google/m2repository/com/google/android/gms/play-services/
Good luck!
Use this setting in your app's build.gradle file:
dependencies {
compile 'com.google.android.gms:play-services:5.0.89'
}
I found the solution posten on the XDA Developers forum:
http://forum.xda-developers.com/coding/java-android/google-play-version-t2845409
Maybe you have same problems with your libraries. You should use the lib that supports last GP version. Please type logs for details.Also try to compile 'com.android.support:appcompat-v7:20.0.+'

Google game services using gradle

Is there a way to add google game services in a simple way using gradle 0.5+ like how its possible with the support library or the google play services:
dependencies {
compile "com.android.support:support-v4:13.0.0"
compile 'com.google.android.gms:play-services:3.1.36'
compile files('libs/GoogleAdMobAdsSdk-6.4.1.jar')
}
Play Game Services is not a separate library from the Google Play Services library. It seems that you are using a very old version of play-services through. Try the newest version, which definitely has the Games API:
compile 'com.google.android.gms:play-services:6.5.87'

Categories

Resources