可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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'
回答1:
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.
回答2:
You don't face this problem if you follow this problem
Inactivity, disconnecting from the service
You Need to follow few steps to remove this problem. Reason: You face this problem because in the background there are few-thread and the process is running in the android studio which uses the connection of firebase and your process not get the connection.
Steps:
- Uninstall the app from your mobile/emulator.
- Then go to the File option in the main menubar in the android studio.
- Then click on Invalidatecasha/restart.
It takes few mints and restarts you android studio and that error is gone. Because all the backend thread and process are closed.
Happy Coding.