Cannot see events in firebase analytics debug view

12,595

Solution 1

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 <package_name>

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

adb shell setprop debug.firebase.analytics.app .none.

iOS test device setup is as easy as Android, just use there Xcode command line arguments correspondingly:

–FIRDebugEnabled and

–FIRDebugDisabled

Solution 2

After performing Enabling debug mode make sure that date&time in your debug device or emulator and in your pc is correct.

Share:
12,595
Melika Barzegaran
Author by

Melika Barzegaran

Updated on June 04, 2022

Comments

  • Melika Barzegaran
    Melika Barzegaran over 1 year

    I'm trying to run a sample app with firebase analytics. I followed the firebase analytics guides to log a test event but I cannot see any events in the debug view. I log a test event on my main activity as below:

    public class MainActivity extends AppCompatActivity
    {
        private FirebaseAnalytics mFirebaseAnalytics;
    
        @Override
        protected void onCreate(Bundle savedInstanceState)
        {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
    
            Bundle bundle = new Bundle();
            bundle.putString("test_parameter", "test_value");
            mFirebaseAnalytics.logEvent("test_event", bundle);
        }
    }
    

    And I use the following command to see my events in the debug view:

    adb shell setprop debug.firebase.analytics.app com.example.firebaseanalyticssample
    

    And I see the logs with the following commands:

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

    I think maybe the problem is the null pointer exception appeared in the logs (the last line):

    05-25 09:25:53.056 V/FA      (21533): Processing queued up service tasks: 2
    05-25 09:25:53.086 V/FA-SVC  ( 5655): Logging event: origin=auto,name=_e,params=Bundle[mParcelledData.dataSize=132]
    05-25 09:25:53.101 V/FA-SVC  ( 5655): Saving event, name, data size: _e, 87
    05-25 09:25:53.106 V/FA-SVC  ( 5655): Event recorded: Event{appId='com.example.firebaseanalyticssample', name='_e', params=Bundle[{_o=auto, _r=1, _et=52395, _sc=MainActivity, _si=-5268297315019047641, _dbg=1}]}
    05-25 09:25:53.106 V/FA-SVC  ( 5655): Upload scheduled in approximately ms: 500
    05-25 09:25:53.111 V/FA-SVC  ( 5655): Background event processing time, ms: 31
    05-25 09:25:53.621 V/FA-SVC  ( 5655): Device receiver got: com.google.android.gms.measurement.UPLOAD
    05-25 09:25:53.646 V/FA-SVC  ( 5655): Device PackageMeasurementService called. startId, action: 194, com.google.android.gms.measurement.UPLOAD
    05-25 09:25:53.651 D/FA-SVC  ( 5655): Uploading events. Elapsed time since last upload attempt (ms): 544
    05-25 09:25:53.666 E/FA-SVC  ( 5655): Task exception on worker thread: java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference: vgq.s(:com.google.android.gms:2650)
    

    I searched a lot and just found this link regarding the exception above that says it must be an error from another application. but whenever my activity is resumed this exception occurs. I don't think that in my case this exception is caused by another apps.

    I checked my sample app a lot of times so that every configuration would be exactly as the guides say. Have you any idea what can be the problem?

  • Melika Barzegaran
    Melika Barzegaran over 6 years
    it didn't make any difference.
  • mrroboaat
    mrroboaat about 6 years
    Same problem, it works with one samsung but with another one it doesn't o_O.
  • Fanchen Bao
    Fanchen Bao over 2 years
    This is a simple copy-and-paste of the documentation. No value is added to answering the OP's question.
  • HDT
    HDT over 2 years
    But someone might miss it that might cause the problem, right? Did you face the same issue or just try to post a negative comment?
  • Fanchen Bao
    Fanchen Bao over 2 years
    Fair enough. I agree that my initial wording was too strong. I just hope that the answer was transparent about its borrowed content and included a reference to the original documentation.
  • HDT
    HDT over 2 years
    ok, no problem. Even though there is already having a mention in the document but I would like to highlight it again. The main reason is Firebase famous libraries did well wrap up. So it doesn't work that might cause by the missing reading document. Our developer also faced the same issue.