21

As it is visible in the console output below, the application usually needs 7-10 seconds to process the service and often fails to do it. This happens on every startup.

Why is it taking so long? Is it because the service is trying to connect multiple times before giving up? Also, what is actually the logic behind this output?

Note: I don't have any FirebaseAnalytics code in my application

09-26 23:34:48.998 /package V/FA: Processing queued up service tasks: 1
09-26 23:34:54.009 /package V/FA: Inactivity, disconnecting from AppMeasurementService
09-26 23:34:57.357 /package V/FA: Activity paused, time: 89152495
09-26 23:34:57.383 /package V/FA: onActivityCreated

build.gradle(app)

//Firebase
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-database:9.4.0'
compile 'com.google.firebase:firebase-invites:9.4.0'
compile 'com.firebase:geofire-android:2.0.0'
compile 'com.firebaseui:firebase-ui:0.5.1'
rupinderjeet
  • 2,984
  • 30
  • 54
Tsvetozar Tsonev
  • 211
  • 1
  • 2
  • 5
  • 1
    The AppManagemenService is part of Firebase Analytics. It is most likely (I'm not an expert on this Firebase feature) trying to capture the fact that the user opened the app. – Frank van Puffelen Sep 26 '16 at 23:27
  • @FrankvanPuffelen I can see the service comes with firebase-core but what I am really interested in is why the whole process around it is taking so long and how to handle it. Any ideas whatsoever are welcome. – Tsvetozar Tsonev Sep 27 '16 at 08:42
  • 1
    What is "the whole process" that takes long. This logging doesn't block application startup. – Frank van Puffelen Sep 27 '16 at 16:54
  • @FrankvanPuffelen When the application reaches the point in the log where I get --Processing queued up service tasks: 1-- it freezes for a few seconds "appearing" to be doing nothing if you consider the UI. After that, coming to the line where it says --Inactivity, disconnecting from AppMeasurementService-- it also takes a few second before giving control back to the user. I am not using any FirebaseAnalytics features and initializations so I don't really know how to trace the problem. – Tsvetozar Tsonev Sep 27 '16 at 20:45

5 Answers5

11

The "Processing queued up service tasks" and "Inactivity, disconnecting from AppMeasurementService" messages are both logged on a worker thread, not the main app thread, so they are not holding up your app.

The processing of queued up service tasks likely completes nearly instantly; the disconnect due to inactivity merely means that no one has asked Firebase Analytics to do anything for a while so it's disconnecting from its service until someone does. That's normal, especially if your app isn't making calls to FirebaseAnalytics.

"Activity paused" means that the app's current activity (screen) has been removed from display; this could be something your app did or user action. Since there's an "onActivityCreated" message right after that I'd say your app got rid of one activity and replaced it with another.

Without more information on what your app is doing it's very difficult to guess why the app might have slow responses.

BTW, try using "adb logcat -v threadtime" to get process and thread IDs in the logging statements.

Dan Morenus
  • 1,068
  • 8
  • 12
1

first make sure that you are using a real time database not cloud firebase and then change the rules as:

{
  "rules": {
    ".read": true,
    ".write": true
  }
}

and make sure that your have put the internet permission

<uses-permission android:name="android.permission.INTERNET" />

and make re-build for our project again that's working for me

Employee
  • 3,109
  • 5
  • 31
  • 50
manar odeh
  • 111
  • 3
1

i had a similar problem i made my apache server the host server for my android application and each time i tried logging in i receive the error
i tried all the above mentioned solution but to no avail until i changed the network setting of my windows 10 from a public network to a private network i think this is because of the firewall settings

if you have same problem

go to network setting -->> click on the network you're connected to -->> and select -->> change to private network

hope it helps

Exekute
  • 33
  • 5
1

If you're only getting FA logs in Android Studio, this is a different problem and it's probably with the device. Check in the Developer Options your Registry Buffer Size and set a buffer limit in case it's deactivated.

J Rom
  • 51
  • 1
  • 4
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 20 '22 at 05:52
0

It is not an error message .Its just a message that firebase has not events to report, it disconnects from the reporting service . May be u dont have interner conection or forget to write permission in your manifest. If yes just add

<uses-permission android:name="android.permission.INTERNET" />

It has solved my problem

L.Petrosyan
  • 430
  • 4
  • 12