Here is my build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
compile 'com.google.android.gms:play-services:9.0.2'
compile 'com.google.firebase:firebase-core:9.0.2'
compile 'com.google.firebase:firebase-analytics:9.0.2'
compile 'com.google.firebase:firebase-ads:9.0.2'
compile 'com.google.firebase:firebase-crash:9.0.2'
compile 'com.google.firebase:firebase-messaging:9.0.2'
}
apply plugin: 'com.google.gms.google-services'
app freezes when the app resumes. it gives anr (activity not responding) error.
is there any problem with play services 9.0+ or with firebase ?
I was solved the issue by removing the line
compile 'com.google.android.gms:play-services:9.0.2'
Seems to be the same issue as this: Firebase Crash produces ANR during launch
The official fix for the incident is an update to the Google Play Services which should be rolling out now.
We've fixed the issue with Firebase Crash initialization in Google Play Services 9.6.83. Users should receive the update sometime within the next two days. We will conduct an internal investigation of this issue and make appropriate improvements to our systems to prevent or minimize future recurrence.
Just add this line to dependencies:
implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
Related
I followed the instructions at Firebase Analytics quick start, but even after 24 hours, no user session was registered at Firebase Console.
I know that my google-services.json is correct because Firebase Auth is working properly (both Google and Facebook users are visible on the dashboard).
My Gradle dependencies are:
dependencies {
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.14.1'
compile 'com.google.android.gms:play-services-auth:9.2.1'
compile 'com.google.android.gms:play-services-maps:9.2.1'
compile 'com.google.code.gson:gson:2.1'
compile 'com.google.firebase:firebase-auth:9.2.1'
compile 'com.google.firebase:firebase-core:9.2.1'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
}
At August, 1st 2016, Google Developers upgraded Firebase quickstart examples on GitHub
Firebase version was upgraded from 9.2.1 to 9.4.0, which seems to have fixed my Analytics update issues.
I was facing same problem what i missed in my project gradle file add this dependency
classpath 'com.google.gms:google-services:3.0.0'
and in my android gradle or you can say app gradle i add this
in last line
apply plugin: 'com.google.gms.google-services'
Let me show you my current build dependencies so you understand my frustation:
dependencies {
compile 'com.google.android.gms:play-services-ads:8.3.+'
compile 'com.google.android.gms:play-services-wearable:8.3.+'
compile 'com.google.android.gms:play-services-plus:8.3.+'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.google.android.gms:play-services-analytics:8.3.+'
compile "com.google.android.gms:play-services-location:8.3.+"
compile 'com.google.android.gms:play-services-gcm:8.3.+'
compile 'com.android.support:design:22.2.+'
//for now disable wearApp dependency for PaidRelease builds
wearApp project(':wearable')
compile 'com.squareup:otto:1.3.5'
compile fileTree(dir: 'libs', include: ['*.jar'])
//compile 'com.android.support:support-v4:22.0.+'
compile 'com.android.support:appcompat-v7:23.0.+'
}
and here are my wearable dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.2.0'
compile 'com.google.android.gms:play-services-wearable:7.5.0'
}
Notice in my apps dependencies i am using 8.3.+ for the version meaning only update minor version changes. Admob wrote me the following a few days ago:
In order to ensure that your ads continue to serve after September 15th, 2016, please upgrade to Google Mobile Ads SDK 7.0.0 or higher.
They said one way to do this is to just update the entire google play services to 9.0.2. But I am not using entire Play Service dependencies. As you can see I just get the exact packages I need to save space and method count.
The issue:
If I were to replace the following line:
compile 'com.google.android.gms:play-services-ads:8.3.+'
with
compile 'com.google.android.gms:play-services-ads:9.0.2'
I am not confident it will work with the 8.3.+ jars I depend on. Wont I have to update the entire google play services jars I am using to be 9.0.+ also?
You're already using version 8.3 as denoted by play-services-ads:8.3.+, well above the 7.0.0 cutoff, so there's no action needed on your part.
Problem: When I add the below dependencies in build.gradle, I am getting a multiDex error. I know this happens if I have unnecessary dependency but I am not able to sort it out. I am doing this for one single push notification in my app.
I added following dependencies to my build.gradle file:
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0'
Before this my app was working fine. All of tthe dependecies in my gradle file are listed below (including the above dependencies)
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/android-support-v4.jar')
compile files('libs/Parse-1.3.0.jar')
compile files('libs/signpost-commonshttp4-1.2.1.2.jar')
compile files('libs/signpost-core-1.2.1.2.jar')
compile files('libs/signpost-jetty6-1.2.1.2.jar')
testCompile 'junit:junit:4.12'
compile files('libs/volley.jar')
compile 'com.google.android.gms:play-services:8.1.0'
compile 'com.google.android.gms:play-services-ads:8.1.0'
compile 'com.google.android.gms:play-services-identity:8.1.0'
compile 'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.onesignal:OneSignal:2.+#aar'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.google.android.gms:play-services-location:8.1.0'
}
Any help on how to fix this?
If your intention is just to add Gcm. you dont need those many dependencies. Especially google play services full version.
compile 'com.google.android.gms:play-services:8.1.0'
Its always good to add smaller dependencies which fits your usecase such as
compile 'com.google.android.gms:play-services-gcm:8.1.0'
If you still are still exceeding 65k limit and need multidex, you must enable in your module gradle file.
multiDexEnabled true
in your module grandle file in defaultConfig.
Along with this, its better enable proguard to keep following attributes as well to make sure you dont bloat up the apk size
minifyEnabled true
shrinkResources true
Note that enabling proguard has its own problems which you will have deal with by carefully reviewing proguard-rules.pro
if you can't solve your application's dependencies.
multi dex application supporting can be solution for that.
http://android-developers.blogspot.kr/2014/12/google-play-services-and-dex-method.html
http://developer.android.com/tools/building/multidex.html
Trying to update my firebaseui. But Why doesn't this work in my gradle file?
compile 'com.firebaseui:firebase-ui:0.4.0'
UPDATE
Still same problem.
My other dependicies ar also updated:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.1'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.maps:google-maps-services:0.1.12'
compile 'com.google.maps.android:android-maps-utils:0.4.3'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-location:9.0.0'
compile 'com.firebase:firebase-simple-login:1.4.2'
compile "com.google.firebase:firebase-database:9.0.0"
compile 'com.firebaseui:firebase-ui:0.4.0'
Update:
The bug has been fixed and the new build is already pushed. Here's the last official reply from the bug post.
Ok I just pushed a fix for this. There will be some propagation delay.
If you can try it in >= 1hr and let me know if it works that
would be great. Just build your project with the gradle flag
--refresh-dependencies to make sure it re-downloads deps and does not use the cached copy.
FirebaseUI is moved to jCenter in 0.4.0, thus it can't be found in mavenCentral. If it's still giving error, try to add Database and Auth dependencies separately, like this
compile 'com.firebaseui:firebase-ui-database:0.4.0'
compile 'com.firebaseui:firebase-ui-auth:0.4.0'
This has been marked as a bug already here. You can read the bug post to read more about this issue.
Here's the official reply on the bug
Ok I'm glad that solved your problem. For what it's worth,
com.firebaseui:firebase-ui:0.4.0 is just an empty library that
declares dependencies on those libraries for convenience.
I will leave this issue open until I can figure out what's going on
with my jCenter configuration, thanks for the report!
For some reason 0.4.0 is not avaible through bintray or mavencentral..
0.3.1 works though, so try that for now. I will look into it later.
'com.firebaseui:firebase-ui:0.3.1'
maoke sure you are using Jcenter.
if compile 'com.firebaseui:firebase-ui-database:0.4.0' and
compile 'com.firebaseui:firebase-ui-auth:0.4.0' still not work for you, try to go to Settings-> Build,execution, Deployment -> and disable offline Work
I searched for ages to determine why my google endpoints module was causing a UNEXPECTED_.._EXCEPTION when I tried to run the App on a emulator.
Research indicated that a library is being called more than once. But I could find no clear error with regard to this:
My app build.gradle:
compile project(path: ':kk_endpoint', configuration: 'android-endpoints')
compile'com.android.support:appcompat-v7:22.2.0'
compile 'com.google.android.gms:play-services:7.5.0'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.squareup.picasso:picasso:2.3.2'
And my Google endpoint module build.gradle:
appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.19'
compile 'com.google.appengine:appengine-endpoints:1.9.19'
compile 'com.google.appengine:appengine-endpoints-deps:1.9.19'
compile 'javax.servlet:servlet-api:2.5'
compile 'com.googlecode.objectify:objectify:5.1.1'
compile 'com.ganyo:gcm-server:1.0.2'
Clearly nothing is being called twice on face level. What could be the cause of this problem?
After hours of research I found that the problem was coming from the guava lib, and all I needed to do was exclude that lib:
compile (project(path: ':kk_endpoint', configuration: 'android-endpoints')) {
exclude(module: 'guava-jdk5')
}
Please note brackets need to be exactly as above or won't work.
compile project(path: ':kk_endpoint', configuration: 'android-endpoints'){
exclude(module: 'guava-jdk5')}
Doesn't work.
I hope this helps someone save hours