Android Studio 2.1.2 with Firebase NOT WORKING - android

whenever I try initiating firebase, there's always these errors
W/GooglePlayServicesUtil: Google Play services out of date. Requires 11020000 but found 8489470
W/FA: Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}
E/FA: Discarding data. Failed to send app launch
E/FA: Failed to get app instance id
E/FA: Failed to send current screen to service
E/FA: Discarding data. Failed to send event to service
I get it's something related to Google Play Services but I just cant figure out how to fix it, I'm running Android Studio 2.1.2 and there's no update for Google Play Services in the SDKs
EDIT: My App Gradle (I'm using an emulator)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.sc.voxcinemascamp"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.google.firebase:firebase-core:11.0.2'
}
apply plugin: 'com.google.gms.google-services'

So, it's clear now. You need either update your emulator to get Play Services 11 installed on it, or downgrade your firebase dependency to match Google Play Services installed on your emulator.
I would rather suggest to update emulator, don't downgrade Play Services used in your app because of emulator.

Uninstall your app on the emulator---go to home screen of your emulator---open google play and login with a gmail account---as soon as youve logged in,you will get a google play update popup or notification that says application will not launch until google play services is updated..follow the screen prompts to update google play,then run your application again.

Got same problem.The problem was in my emulator.Just upgraded my emulators google play services and it worked fine.Or try to run in another emulator which has upgrade version of google play services.

Related

Android App is not installable from Play Store in spite of targeting the right SDK. Why?

Here is my Gradle file without the dependencies;
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.xxx.yyy"
minSdkVersion 15
targetSdkVersion 27
versionCode 2
versionName "1.1"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
The App is published on the Play Store, but says "This app is incompatible with your device." on the web and doesn't show in search results on the mobile Play Store. When I push from Android Studio, of course, it runs on the phone.
Also, I am only using two basic permissions for this app. Do I have to do anything else? In the previous version (1) of this app, I had targeted SDK 19 and it was throwing the incompatibility error. So, I changed to 27, built and tested again, then uploaded. Now, I still get the same error. The app status is "Published" now. Could this be a bug on Play Store?
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Please help. Thanks!
I went to my developer console, Release Management->Artifact Library, clicked on the small info button next to my release. It said "Supported Devices: 0". I was horrified.
I went to my app, removed a Java IOUtils library that wasn't needed in my code. Then there was a warning during build about a WebView feature that wasn't needed (which was only for older SDKs), I removed that. Then added an action.VIEW intent filter to one of the activities. Then, I made minimum SDK 16 instead of 15. Then I changed the dependecies;
implementation 'com.android.support:design:27.0.2'
compile 'com.android.support:appcompat-v7:27.0.2'
As of writing this, this was the latest available. Then, cleaned it, built app, tested again.
Then, I updated the version code and version name, generated another signed APK.
I uploaded version 1.2. Waited for a while.
Now, it shows multiple supported devices from SDK 16 to 27. I still don't know what fixed it. Thanks Google.
Regards

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'

Android app backward compatible version of google play services API

when I deploy my android app on android mobile version 4.4 (lollipop), I am getting a message that "app won't run unless you update Google play services"
I looked at my android mobile and can see that Google play services version is 5.1.89. I know in my code I am using 8.4.0
I don't want android to show popup to user to update google play services
can any android mobile app expert help me fix this issue.
how do I make my app backward compatible without asking user to update google services?
my build.gradle is as follows
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
buildTypes {
debug {
debuggable true
}
}
defaultConfig {
applicationId "com.me"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
preDexLibraries = false
}
packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.google.android.gms:play-services-maps:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
}
As described in the Google Play Services overview, the service consists of two parts: the client library that is linked into the application at build time, as well as the Google Play services APK, to which the client library connects using inter-process communication (IPC).
You generally only need to upgrade the client library if you wish to use new features of Google Play Services or if you're hit by a bug that is fixed in a later release.
The Google Play services APK runs as a background service that provides the actual Google services to your application. With this split model, Google can promptly push out new features, service updates and critical bug fixes to end-user devices without needing to wait for carriers or device manufacturers to implement these fixes.
As a consequence, the Google Play services APK has to be backwards compatible with previously released versions of the client library to avoid breaking developer's applications each time it is updated.
The opposite, however, is not true. If you build your application using a specific version of the client library the installed Google Play services APK version must not be older than that.
So if you build against library version 5.1.89 your app will work with version 8.4.0 of the APK, but won't if the installed version is, e.g., 5.0.0.
A well behaved application always checks the availability and version of the installed Google Play services APK before accessing a service, as explained in the Google Play services setup guide. This is exactly what you see in action when the end user is prompted to update Google Play Services on the device, and it's the best you as an application developer can do, since you can't force an update on the end user's device and the alternative would be to have your application crash.

Android Wear: Google Play services out of date. Requires 9256000 but found 8701534

I can't get my Android Wear app to work. Every time it tries to open something on the phone I keep getting this error in the logcat:
W/GooglePlayServicesUtil: Google Play services out of date. Requires 9256000 but found 8701534
Nothing should be wrong with my application, because it worked before. It stopped working when I did a factory reset on my LG G Watch.
I checked the Google Play version codes on the watch with an app, and it is (as the logcat tells) 8701534. (Why isn't it updating?) My phone has the version code 9256448. Here are some screenshots:
(Click for larger screenshots).
Here is the (shortened) build.gradle of the watch:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.my.packagename"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.3.0'
compile 'com.google.android.gms:play-services-wearable:9.2.0'
}
And here is the (shortened) build.gradle of the phone:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.my.packagename"
minSdkVersion 11
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.google.android.gms:play-services-wearable:9.2.0'
...
}
I have already tried the usual things like:
Factory reset on the watch (About 5 times already)
Cleared cache/data of Google Play services on the phone
Reinstalled Google Play Services on the phone.
Connected the watch to 3 different devices. See below for device names.
Leave the watch connected for about 12 hours. (Both phone and watch connected and on the charger). Nothing changed.
Changed compile 'com.google.android.gms:play-services-wearable:9.2.0' to compile 'com.google.android.gms:play-services-wearable:+'
Here are the phone models I tried on including the watch:
LG G Watch LGW100 (Android 6.0.1, Android Wear 1.5)
Huawei Nexus 6P (Android Nougat Preview 4)
Samsung Galaxy S5 (Android 6.0.1)
Samsung Galaxy S6 (Android 6.0.1)
I'm sure it isn't the phone because I had the watch connected on three different devices.
Do you have any suggestions?
I had the same problem today and somehow I managed to overcome it. Things I did:
reinstalled Android Wear on the phone (due to this)
unpaired the watch from the Android Wear app, then repaired it
resynced apps from the Android Wear app a couple of times
on the watch, in Settings/About/Versions, I tapped the GMS version a couple of times. It should say 'Checking for updates'. At first there were errors in logcat at this operation, then (after reinstalling, etc.) these disappeared.
started Maps and Fit (hoping that they somehow trigger the update)
It finally updated. It took a few days for it to update Google Play services. Now it has version 9.2.56. I guess it just takes some time for the watch to update Google Play services.
You can edit the dependency version:
compile 'com.google.android.gms:play-services-wearable:8.7.0'
Notice 8.7 instead of 9.2. Also please note that this isnt a fix, its a workaround.
Edit: In a perfect world, all watches will instantaneously update to the latest play services, but that doesnt seem to be the case yet. This is also why I declared this as a workaround rather than a fix.
Another option is to manually upgrade Google Play services via odb:
download latest Google Play services apk (from here)
install it via adb install -r com.google.android.gms*
My watches (Samsung Gear S with Wear 1.5) had extremely old version of Google Play services after factory reset (same as yours: 8.7.01 - 534) and did not install any application after pairing. Manually updating play services solved that.

App wont run unless you update google play services

Whenever I run my app in my emulator, which uses the Google maps API, I get the error "App wont run unless you update google play services". I've digged through some other questions about the same topic here on SO, since there are many, but I did not find a solution yet. So how do I get the Google maps API to work on my emulator?
When I go through installed apps on the emlator I don't see Google Play services in the list. So I am guessing this is the problem? If so, how do I get this on my device? Or isn't it possible at all on an emulator to use Google Play services?
I am using an emulator with Google API enabled.
Here is my Gradle build file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.example.thomas.app"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile 'com.android.support:support-v4:23.0.1'
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.android.support:design:23.0.1'
}
I had this same problem. I opened my emulator, went to Settings -> Apps -> Google Play services, and noted the version (in my case, 8.1.65). Then I opened my build.gradle and saw that the version there for com.google.android.gms:play-services was 8.3.0. I changed it to 8.1.0 and it worked on the emulator.
You might have to do a check in your code if the user has Google play services installed. If they dont, prompt them to download it from the play store.
So There was no way to make Google play services run the default Android emulator shipped with the SDK . So instead I started to look into other emulators and found xamarin android player. I got Google play store and Google play services working on it in no time. So if anyone also has this issue, use this emulator instead. The only downside is you can't debug in it.
I got around this limitation of Android emulators by using Samsung's Device Test Lab - http://developer.samsung.com/remotetestlab. You can launch from a multitude of devices there, which all have Play Services.

Categories

Resources