2016-06-23 6 views
2

ich Störung erhalte:Fehler auf im Dienst Realtime-Datenbank getting

06-24 10:41:36.497 17316-17316/com.example.waseem.geolocation:location_service E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.waseem.geolocation:location_service, PID: 17316 java.lang.RuntimeException: Unable to instantiate service com.example.waseem.geolocation.LocationService: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist. at android.app.ActivityThread.handleCreateService(ActivityThread.java:3085) at android.app.ActivityThread.access$1900(ActivityThread.java:172) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1505) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:5832) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) Caused by: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist. at com.google.firebase.FirebaseApp.getInstance(Unknown Source) at com.google.firebase.FirebaseApp.getInstance(Unknown Source) at com.google.firebase.database.FirebaseDatabase.getInstance(Unknown Source) at com.example.waseem.geolocation.LocationService.(LocationService.java:34) at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.Class.newInstance(Class.java:1650) at android.app.ActivityThread.handleCreateService(ActivityThread.java:3082) at android.app.ActivityThread.access$1900(ActivityThread.java:172)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1505)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:145)  at android.app.ActivityThread.main(ActivityThread.java:5832)  at java.lang.reflect.Method.invoke(Native Method)  at java.lang.reflect.Method.invoke(Method.java:372)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194) `.

auf

DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference(); 

Aussage in Service, aber seine Werke fein in Tätigkeit.

+0

Im Lebenszyklus Ihrer App: Wann wird der Dienst gestartet? Setzen Sie Ihre Protokollierungsstufe auf info und sehen Sie sich die logcat-Ausgabe für "FirebaseInitProvider: FirebaseApp Initialisierung erfolgreich" an. Erscheint es, wenn Ihre App initialisiert wird? –

+1

Bitte buchen Sie den kompletten Aufruf-Stack für die Ausnahme. Enthält Ihre App Firebase Crash Reporting (com.google.firebase: firebase-crash: 9.0.2)? –

+0

@qbix Bitte überprüfen Sie die aktualisierte Frage Ich fügte vollständigen Stapel von Fehler –

Antwort

3

Ich fand meine Problemlösung von mir und das Problem ist, ich diese Störung erhalte, weil ich meinen Dienst in verschiedenen Verfahren leite, die in einem offenkundigen definieren, wo ich meinen Dienst erklären:

android:process = "......" 

, wenn ich es entfernt und jetzt läuft mein Dienst auf dem Hauptprozess der Anwendung und ich bekomme keinen Fehler und es funktioniert gut.