简体   繁体   中英

Android App freezes after implementing Google Firebase

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 ?

我通过删除该行解决了这个问题

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.

只需将此行添加到依赖项:

implementation 'com.firebaseui:firebase-ui-auth:7.1.1'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM