可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I linked my Android app with Firebase using Android Studio
Which created and set my google-service.json into my project.
When i debug my event logging in logcat i got :
V/FA-SVC: Successful upload. Got network response. code, size: 204, 0
But nothing is showing into firebase console debug view
回答1:
Test device setup
To enable sending of DebugView data on a connected Android test device for a configured Firebase Analytics app, execute the following command:
adb shell setprop debug.firebase.analytics.app [your_app_package_name]
This behavior persists until you explicitly disable it by executing the following command:
adb shell setprop debug.firebase.analytics.app .none.
回答2:
After performing Enabling debug mode make sure that date&time in your debug device or emulator and in your pc is correct.
回答3:
Enabling debug logging is different from enabling debug mode. As Frank van Puffelen suggested in his comment, to enable debug mode you need to set "debug.firebase.analytics.app" property to your app package name.
You can do this using adb with the following command:
adb shell setprop debug.firebase.analytics.app "your.app.package.name"
You can find the package name of your app inside your AndroidManifest.xml
as the package
attribute on the manifest
element (first element in the xml document).
回答4:
Also make sure that you have the latest Google Play Services installed in the device/emulator or nothing is guaranteed to work.
If you go to the settings on your emulator, there is Update button for that. Unfortunately it requires you to sign-in via your Google account.
回答5:
- Run your app in debug mode
- Goto Developer Options -> Select debug app -> Select
You will see your device listed in Firebase DebugView
回答6:
As others have mentioned, I think commonly the issue here is using the wrong package name. I had this problem with an app I recently started collaborating on, and using the package attribute from AndroidManifest.xml wasn't working. I suspected that the build was appending something to the package name but couldn't find the place where this was defined. The simplest way I found to discover the actual package name was to launch "Attach debugger to Android process" in the top bar on Android Studio, which then shows a list of processes with their associated package names on the AVD. Sure enough, using the correctly-appended package name taken from this list did then cause Firebase Analytics Debug View to wake up.
回答7:
Disable any ad-blocking mechanism in your debugging device. This was the problem here. I had AdAway enabled.
I know the question is old, however it may help someone.
回答8:
For me the problem was using "package name" in the adb command as they suggest in the docs. But whay you must use is the applicationId of your build. Though they are the same a lot of times they can be different if you specify another appId in build.gradle
file or add postfixes for some specific build variants.
I don't know why they always use the "package name" words for it, since it just means the way we organize our code.