应用程序初始化非常慢:FirebaseApp初始化失败 [英] App initialization very slow: FirebaseApp initialization unsuccessful
问题描述
我知道这个问题,但我不认为这对我和问题有所帮助看起来有点不同。
我正在做这个应用程序,我需要实现AppsFlyer进行跟踪,我只需要使用Google Play服务中的两个组件:
com.google.android.gms:play-services-ads
com。 google.android.gms:play-services-gcm
我正在使用最新版本的Google Play服务9.0。 2就是这样。
问题是,在安装应用程序后第一次启动应用程序时,应用程序需要相当多的时间才能启动。没有日志输出,当应用程序开始执行某些操作时,日志中的第一行是:
06-16 16:50:23.782 22368-22368 / com.company.app I / FirebaseInitProvider:
FirebaseApp初始化失败
我没有使用Firebase,我怎么能摆脱这个?它确实减慢了应用程序的初始化。不是一个非常好的用户体验......
编辑:
我一次添加了两个库,我意识到GCM是造成这个问题的原因之一。当我添加:
com.google.android.gms:play-services-gcm
我开始获取FirebaseApp初始化失败日志,该应用需要一段时间才能启动。也许降级会修复这个问题,但这不是一个很好的解决方案。
我建议您排除 firebase
使用 gradle
的组:
compile('com.google.android.gms:play-services-ads:9.0.2'){
exclude group:'com.google.firebase',module:'firebase-common'
compile('com.google.android.gms:play-services-gcm:9.0.2'){
exclude group:'com.google.firebase',module :'firebase-common'
}
或者,只需应用全局排除配置这:
配置{
全部* .exclude组:'com.google.firebase',模块:'firebase -common'
}
希望它有助于:)
I know about this question but I don't think it helps me and the problem looks slightly different.
I'm doing this app where I need to implement AppsFlyer for tracking and I'm required to use only 2 components from Google Play Services:
com.google.android.gms:play-services-ads
com.google.android.gms:play-services-gcm
And I'm using the latest version of the Google Play Services, 9.0.2 that is.
The problem is that on the first app launch after installing the app, the app takes quite a bit of time to start. There's no log output and when the app starts doing something, the first line on the log is:
06-16 16:50:23.782 22368-22368/com.company.app I/FirebaseInitProvider: FirebaseApp initialization unsuccessful
I'm not using Firebase, how can I get rid of this? It really slows down the application initialization. Not a very good user experience...
EDIT:
I've added both libs, one at a time and I've realized that the GCM is the one causing the issue. When I add:
com.google.android.gms:play-services-gcm
I start getting the "FirebaseApp initialization unsuccessful" log and the app takes a while to start. Perhaps downgrading "fixes" the problem, but that's not a very good solution.
I would suggest you to exclude the firebase
group using gradle
:
compile('com.google.android.gms:play-services-ads:9.0.2') {
exclude group: 'com.google.firebase', module: 'firebase-common'
}
compile('com.google.android.gms:play-services-gcm:9.0.2') {
exclude group: 'com.google.firebase', module: 'firebase-common'
}
Or, simply apply a global exclude configuration, like this:
configurations {
all*.exclude group: 'com.google.firebase', module: 'firebase-common'
}
Hope it helps :)
这篇关于应用程序初始化非常慢:FirebaseApp初始化失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!