Default FirebaseApp is not initialized in this process com.example.app. Make sure to call FirebaseApp.initializeApp(Context) first.
Firebase Remote Config를 추가 한 Android 앱 메시지 에 몇 가지 예외가 있습니다.
스택 추적은 다음과 같습니다.
Fatal Exception: java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process com.example.app. Make sure to call FirebaseApp.initializeApp(Context) first.
at com.google.firebase.FirebaseApp.getInstance(Unknown Source)
at com.google.firebase.remoteconfig.FirebaseRemoteConfig.getInstance(Unknown Source)
at com.example.app.fragments.SomeFragment.updateFooter(SourceFile:295)
at com.example.app.fragments.SomeFragment.onCreateView(SourceFile:205)
at android.support.v4.app.Fragment.performCreateView(SourceFile:2080)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1108)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1290)
at android.support.v4.app.BackStackRecord.run(SourceFile:801)
at android.support.v4.app.FragmentManagerImpl.execSingleAction(SourceFile:1638)
at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(SourceFile:679)
at android.support.v4.app.FragmentPagerAdapter.finishUpdate(SourceFile:143)
at android.support.v4.view.ViewPager.populate(SourceFile:1240)
at android.support.v4.view.ViewPager.populate(SourceFile:1088)
at android.support.v4.view.ViewPager.setAdapter(SourceFile:542)
at com.example.app.SomeActivity.onSomeAsyncCallback(SourceFile:908)
at com.example.app.SomeDataRetriever.onAsyncHttpCompleted(SourceFile:72)
at com.example.app.io.AsyncHttp.onPostExecute(SourceFile:141)
at com.example.app.io.AsyncHttp.onPostExecute(SourceFile:19)
at android.os.AsyncTask.finish(AsyncTask.java:679)
at android.os.AsyncTask.access$500(AsyncTask.java:180)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:696)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5665)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:799)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:689)
이 버전은 9.6.1이며 다른 Firebase 구성 요소도 사용하고 있습니다.
compile 'com.google.firebase:firebase-ads:9.6.1'
compile 'com.google.firebase:firebase-config:9.6.1'
compile 'com.google.firebase:firebase-invites:9.6.1'
compile "com.google.firebase:firebase-messaging:9.6.1"
문서 와 Javadoc 에서 알 수 있듯이 우리의 경우 수동 초기화를 수행 할 필요가 없습니다.
다양한 기기의 Android 4-6에서는 예외가 발생합니다.
편집하다:
이 질문에 약간의주의가 필요합니다. 나는이 설명이 당신 중 일부에게 흥미로울 수 있다고 생각합니다 : https://firebase.googleblog.com/2016/12/how-does-firebase-initialize-on-android.html