12

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 ?

Parth Patel
  • 6,498
  • 3
  • 16
  • 29
  • where does you app freez and where is your anr log? – tyczj Jun 06 '16 at 14:29
  • when i come back to the app from minimized state like for ex. i press home button on running app and then come back to the app then app freezed and after some sec it gives anr. – Parth Patel Jun 06 '16 at 14:30
  • I am seeing a similar issue, with this in the logs: D/FirebaseApp: Notifying background state change listeners. – Innova Jun 06 '16 at 16:22
  • 1
    Parte Patel, do you have copy of the logcat, and with version of Android Studio are you using. – Maria Mercedes Wyss Alvarez Jun 06 '16 at 23:22
  • Just to add to this, getting the same issue, using the same firebase modules. What I experience is the app works perfectly fine until it backgrounds, sometimes it returns the first time ok, but never more than once, second time onward it hangs, looks like the UI thread is locked. This is the [ANR log](http://pastebin.com/eJfirjGC) from the latest crash. Also, using Android Studio 2.2 Preview 2. Logcat shows no errors only the debug message @Innova mentioned above – Rick Tonoli Jun 07 '16 at 19:24
  • Ok so I've removed the problem by following the advice [here](http://stackoverflow.com/questions/37380974/app-stops-responding-after-resuming-from-background-sometimes-could-firebase-be) and only including specific play services dependencies (for me I only needed identity) – Rick Tonoli Jun 08 '16 at 05:55

3 Answers3

6

I was solved the issue by removing the line

compile 'com.google.android.gms:play-services:9.0.2'
Parth Patel
  • 6,498
  • 3
  • 16
  • 29
  • 3
    after 3 days of headache, I found this answer. I can't release my app without google service because I want to show Admob's ads. Thank god, instead of `play-services.9.0.2`, I add `compile 'com.google.android.gms:play-services-ads:9.0.2'` and the issue gone away. – Nguyen Minh Binh Jun 18 '16 at 15:29
0

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.

Community
  • 1
  • 1
art
  • 115
  • 1
  • 7
0

Just add this line to dependencies:

implementation 'com.firebaseui:firebase-ui-auth:7.1.1'
Anatolii
  • 14,139
  • 4
  • 35
  • 65