Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
463 views
in Technique[技术] by (71.8m points)

android - Firebase analytics AppMeasurement not enabled

I have followed all the instructions for integrating Firebase analytics correctly in my project. But when I enable debug logging to make sure the events are being sent (using instructions from here) I see

E/FA      ( 3556): AppMeasurementReceiver not registered/enabled
E/FA      ( 3556): AppMeasurementService not registered/enabled
E/FA      ( 3556): Uploading is not possible. App measurement disabled

and obviously the events are not being sent.

Again I have followed all the instructions .

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It turns out that Firebase Library has an Android Manifest file in which it defines these nodes:

 <service android:name="com.google.android.gms.measurement.AppMeasurementService"
     android:enabled="true"
     android:exported="false"/>

 <receiver android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
     android:enabled="true">
     <intent-filter>
         <action android:name="com.google.android.gms.measurement.UPLOAD" />
     </intent-filter>
 </receiver>

based on AppMeasurementService and AppMeasurementReceiver

which are needed for analytics to work and my problem was that I was replacing all the library nodes with <tools:node=”replace”> in my Android Manifest which in turn ignored the needed nodes for analytics lib.

Removing <tools:node=”replace”> and replacing my conflicts specifically solved my problem.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...