Firebase Analytics Debug View does not show anything
Asked Answered
P

26

107

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

Phylogeny answered 13/3, 2017 at 16:55 Comment(11)
You need to enable it for you app: adb shell setprop debug.firebase.analytics.app ***package_name***Campion
I did it. I also activate additional logging which provide the line i mentionned.Phylogeny
have you found any reason?? 1. enabled adb debug 2. saw in log also but not in debug viewTelemotor
V/FA-SVC: Successful upload. Got network response. code, size: 204, 0; Firebase says My app is connected on first use. But still can't see Debug Events; I did adb shell setprop on app package; also matched gmp_app_id: 1:8427#####:android:7dd######### in json file. Am on Spark plan! @LokeshTiwariMitre
Also doesn't work for me - did everything as per the documentation. DebugView always says "No devices available" in the top left selector.Improvement
For me, firebase debuging works for debug build of the app, but it doesn't work for the release build. I didn't find any documentation about that. Is this case with anyone else?Dekeles
For me it was the following sequence 'reboot device, uninstall & install the app' then device appeared in DebugView.Revivalism
you probably need to enable the debug mode using this: firebase.google.com/docs/analytics/… TLDR; 1. to enable debug mode: adb shell setprop debug.firebase.analytics.app package_name (get the package name from your AndroidManifest.xml file, i.e. the value of package) 2. to disable it (when you're done): adb shell setprop debug.firebase.analytics.app .none.Serialize
Thanks @Revivalism a fresh install was what it took for meBetide
should application be in debug mode??Prepay
Started randomly working after rebooting emulator, force closing the app, restarting android studio etc. It's a bit glitchy it seems.Fehr
K
113

Test device setup

To enable sending of DebugView data on a connected Android test device for a configured Firebase Analytics app, you can follow the step below:

  1. If you are simply working with single build variant, the following command is enough:

    adb shell setprop debug.firebase.analytics.app [your_app_package_name]
    
  2. But if you are working with multiple build variants with different application IDs which are not the same as the app package name, be sure to execute the following command:

    adb shell setprop debug.firebase.analytics.app [your_application_id]
    

    Here, application ID is the app ID of your build variant found in the corresponding gradle file. For example, lets say you have x.gradle and y.gradle for two build variants x and y, and you also have the general build.gradle file. To debug the build variant x with application ID com.abc.x, the command will be:

    adb shell setprop debug.firebase.analytics.app com.abc.x
    

    Similarly, to debug the build variant y with application ID com.abc.y, the command will be:

    adb shell setprop debug.firebase.analytics.app com.abc.y
    

This behavior persists until you explicitly disable it by executing the following command:

adb shell setprop debug.firebase.analytics.app .none.
Kayleigh answered 18/5, 2017 at 11:56 Comment(6)
If you have more than one emulator running, you have to use adb -s SERIAL (SERIAL for the unique id of the emulator). If one device and one emulator are connected you can use shortcuts: adb -d ... for device and adb -e ... for emulator.Bejarano
I have the app installed and simulator is in debug mode any other prerequisite required to see the data in firebase? The app is a React Native android app and for react native iOS app all data are tracked from real devices.Newsreel
it says no device attached in firebase console debug view.Vassalize
How to add another test device? The other device is not with me. It's with the testing team. They do not have Android studio installed. Please help. I am able to see debug events that are triggered from my phone. Unable to see events triggered from other phonesLobo
my problem is multiple build variants ,how do i know my [your_application_id] ?Nadya
Was anyone able to find the solution to the problem mentioned by @VijaiGunasekar I'm looking for the solution for the same issue.Septempartite
H
56
  1. Run your app in debug mode
  2. Goto Developer Options -> Select debug app -> Select

You will see your device listed in Firebase DebugView

Harmonia answered 27/6, 2019 at 7:19 Comment(5)
Do we have to do this every time Android Studio does a full rebuild? Given the app gets deleted and reinstalledCracked
I think this is the correct answer as it will confirm the full application name including the varients that you are currently runningWaxler
This helped. Such a shame that it is not present in the official documentation.Tomi
Where's the Developer Options?Crossgarnet
Developer Options can be found on your device. It is under Settings/System/(advanced), but only if you have enabled developer mode. To enable developer mode, Go to Settings/About phone and tap seven times on the build number. It should give a confirmation toast.Tita
O
35

After performing steps from Enabling debug mode, make sure that date and time on your debug device or emulator and on your PC is correct.

If after correcting the date and time events are still not showing on DebugView, clear the app storage. Then restart the app and try again.

Oversee answered 9/10, 2017 at 15:10 Comment(3)
absolutely true make sure the phone/emulator time matches the AndroidStudio time.Toreador
Clearing the app storage was the only thing that worked for me, thank you!Dodecagon
Same for me clearing the app storage was the only thing that worked for me. Also, reinstall the app same time, thank you!Parallelize
H
30

In my case, even running the adb shell setprop debug.firebase.analytics.app "your.app.package.name" didn't help. While I was hopelessly trying to find something, I decided to check the firebase plugin for Android Studio for something related and found out under the section for analytics that the following commands are needed for verbose logging:

adb shell setprop log.tag.FA VERBOSE
adb shell setprop log.tag.FA-SVC VERBOSE
adb logcat -v time -s FA FA-SVC

I thought that it might be helpful at least to see if the app is sending out some tracking information to the servers at all and run those commands. For my big surprise, it helped also the DebugView and I was then able to see my device.

Hildehildebrand answered 31/8, 2021 at 11:59 Comment(2)
Thanks. This works for me Unity 2020.3.20f1 os windows. Also I found the best video about these commands youtube.com/watch?v=JDxXiarsrHkUnarmed
Thank you. It helps a lot! Next time I have a problem with analytics I will check for this. It should be written in the docs.Styptic
M
27

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).

Metameric answered 14/3, 2017 at 18:0 Comment(6)
Package name should be defined in gradle file ;)Christchurch
how will I do that for iosPeggi
Do you execute the adb command on the android device/emulator, or in the development machine's terminal? If the latter, how does it know which emulator to affect, or does it do all of them?Archbishop
To answer my own question, you enter it on the development machines terminal. However, the quotes around packagename was the issue. It worked for me with no quotes.Archbishop
Also make sure you have the right package name. My debug package name was different because I was using build variants and hence .dev was added to my debug buildGastelum
Package name has been removed from the AndroidManifest.xml fileEffeminacy
H
18

Delete the App on the device/emulator first!

From the terminal run:

adb shell setprop debug.firebase.analytics.app [your_app_package_name]

Then rebuild/debug the app on your device/emulator.

Finally your debug data will show up in Firebase > Analytics > DebugView

People have said "erase content and settings" and "clear the app storage"...etc, but I didn't get it and have spent hours trying to get this working. All you need to do to clear this out is delete the app from your device. Debug won't work unless all the app data is cleared out.

If you are looking for your_app_package_name, its in your AndroidManifest.xml file under package.

UPDATE 2023: If you are looking for your_app_package_name, it now could be in your build.gradle file under applicationId.

Horologium answered 3/2, 2022 at 18:17 Comment(0)
F
10

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.

enter image description here

Floweret answered 4/11, 2017 at 22:34 Comment(1)
This is not an option on my emulator as at December 2022Archimedes
E
5

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.

Embankment answered 18/1, 2019 at 11:2 Comment(0)
J
5

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.

Jackfruit answered 29/6, 2019 at 17:13 Comment(0)
E
5

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.

Eatables answered 22/1, 2020 at 8:18 Comment(0)
D
3

In my case, I did two things:

Firstly

I add the following command in android studio Terminal

adb shell setprop debug.firebase.analytics.app [your_application_id]

Secondly:

I went to the Developer Options on my phyiscal device, and i clicked "Select debug app", then i chose my app.

then my device appeared on Debug View devices.

Donkey answered 22/4, 2022 at 15:10 Comment(0)
H
2

I had problems with events and devices not showing up in the Firebase Debug View.

Found out that my pi-hole on my network was eating all the events. So if if you have any kind of ad blocker on your network, disable it and try again.

Hollah answered 26/2, 2021 at 16:16 Comment(1)
This right here was the correct answer for me xD Thanks!Loader
I
1

After reading the comment here, I found it helpful to run the following commands from a terminal:

adb kill-server
adb start-server
adb shell setprop debug.firebase.analytics.app package_name

Then I was able to select my emulator from the Firebase debug device list and see Firebase events from an app running in Android Studio Bumblebee | 2021.1.1 Beta 1

Invigorate answered 9/10, 2021 at 20:55 Comment(0)
N
1

After trying every potential solution on the internet, and none of them working. These are the steps I used to finally enable DebugView to find my device:

  1. Close the app on the device you’re working on

  2. Go to the Firebase console and sign out of your account

  3. Sign back in again, go to the console and select the project you’re working on.

  4. Again, not sure if this made a difference however do NOT click on DebugView item under the “Project shortcuts” list. Instead, click on the “Analytics” drop-down and select DebugView from there.

It may be possible that this process updates the data stream used in the DebugView page - after following these steps I noticed events which had been missed initially were now showing up - almost as if the event was sent/received properly however the DebugView wasn’t showing the correct data stream.

Bonus tip:

Had issues with this again today, and after signing out/in to Firebase the DebugView still wasn't finding my device. What fixed it was, on my device, move the app into the background i.e. swipe up from the bottom to go to the home screen...

When you re-open the app into the foreground, the DebugView should now start displaying events. I imagine this works because the action of moving the app into the background I believe triggers any saved events on the device to be sent to Firebase, essentially flushing the queue.

Nephrosis answered 27/9, 2022 at 8:58 Comment(0)
E
0

I configured everything correctly and had an emulator and a device running. The emulator events showed up, but the device didn't. 2 hours later I figured out that there is a device-selector in the DebugView and selecting the device was showing the events all the time:

enter image description here

Edaedacious answered 5/7, 2021 at 22:31 Comment(0)
E
0

If you are on iOS simulator. Try this:

Step1 : "Erase All content and settings" on simulator and let the simulator start again

Step2 : start your app

Step3 : Close the firebase debug tab and start again.

The debug logs were not coming for me and after doing this I am successfully getting the logs.

Note : The above thing happened atleast 7/8 times from past few days.

Electrograph answered 31/1, 2022 at 7:28 Comment(0)
E
0

First of all check if your bebugging device is connected to the internet, because without an active internet connection Firebase will of course not receive any debugging data.

Secondly, your debugging device may be showing multiple times on Firebase Analytics Debug View, like mine was.

Strangely enough, you'll have to select the correct item corresponding to your currently running device so that you can see the live logs. It looks like Google keeps your device listed from previous debugging sessions, rather than replacing the session with the current one, which in my opinion would be the right approach to follow.

enter image description here

Erythroblastosis answered 19/3, 2022 at 20:37 Comment(0)
C
0

I'm not sure if you have received your answer or not, but one thing that got me snagged up was all the directions say to do, is enter this command and use your package name. BUT, if you are using flavors and adding package suffixes then you must make sure you have that in the shell command as well.

If you have a dev / uat / prod variant/flavor combo , make sure that you are adding the suffix if you have one. In my instance I have a '.dev' suffix, so my command looks as follows:

adb shell setprop debug.firebase.analytics.app com.myapp.something.dev
Chicalote answered 25/3, 2022 at 17:38 Comment(0)
O
0

Firstly, You should delete the App on the device or emulator.

I faced a similar situation. I ran the following command on Windows device

adb shell setprop debug.firebase.analytics.app "app_package_name"

You can find out from AndroidManifest.xml file.

enter image description here

It's worked.

Offwhite answered 11/4, 2022 at 13:25 Comment(0)
O
0

If everything is properly set up and still Debug View is not working

I face this issue even though I have enabled the Debug view via command and cross-checked with some other device & system which works properly. But somehow it was not working on my emulator. This might also happen on a real device.

Solution for not working only on a specific device or emulator in the system:

To see the logs & events in Debug View. We need to make sure that the emulator or device Date & Time with Timezone are set to our local time which should be also the same in the analytics console. After making same date and time I was able to see the logs & event in Debug View.

enter image description here

I hope this might help those who have followed all the things correctly but missed this case.

Operator answered 27/4, 2022 at 6:13 Comment(1)
I had this issue, I was testing something else and moved the date to future.Dock
I
0

Enable Firebase debug mode

Use this command to enable firebase debug mode on your device.

adb shell setprop debug.firebase.analytics.app yourappid

Use the following command to check the app id (package name) if you are not sure.

aapt dump badging path-to-your-apk

for example: aapt dump badging c:\myapp.apk

Check google_app_id correctness

And make make sure your app is using the expected google app id especially when the app has variants.

You can use apktool to un-package your apk, and find the google_app_id in /res/values/strings which should be the same as the app id in the firebase project setting.

If the google_app_id of your apk is not expected, you may need to check if it's using the right google-services.json.

Clean your project and rebuild, if everything look good.

Find google_app_id in your apk enter image description here enter image description here

Ileum answered 26/8, 2022 at 7:59 Comment(0)
B
0

Thanks GETEM5 for idea. I have tried everything possible, but no result. After moving the application to the background, the application disconnected from the debugger, it unloaded, launched it again from the application icon and the device appeared in DebugView in realtime...but can help just moving to the background for sending i think.

Benoni answered 18/10, 2022 at 18:19 Comment(0)
C
0

There's one option that worked for me

adb shell setprop debug.firebase.analytics.app com.yourapp in your ..\AppData\Local\Android\Sdk\platform-tool

Chemnitz answered 8/11, 2023 at 14:8 Comment(0)
A
-1

In my case, I replaced previous google-services.json file with new one. For this case, I needed to remove the "build" folder, rebuild the project, did debug run on device also followed other steps like, adb shell setprop debug.firebase.analytics.app "your.app.package.name" too. Then it worked.

Amoreta answered 31/12, 2020 at 5:8 Comment(0)
M
-1

install the required NDK version for your project. Version 21.0.6113669 worked for me

see this image for details installation

Malaise answered 13/4, 2022 at 11:47 Comment(0)
S
-1

I'm having the same issue. DebugView works fine with emulator, but distributed app isn't getting picked up. I've checked the schemas and they include the flag:

         <CommandLineArgument
        argument = "-FIRDebugEnabled"
        isEnabled = "YES">

Any ideas how to make it work on distributed app? I'm using AppCenter just in case.

Subject answered 26/8, 2022 at 17:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.