title: MeasurementBrokerService keeps appearing under my application
body: <p>I've tried to add Firebase Cloud Messaging and Google/Firebase Analytics in my Application.</p>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.Web"
  android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
  android:versionCode="26"
  android:versionName="1.2.60"&gt;
  &lt;uses-sdk
      android:minSdkVersion="15"
      android:targetSdkVersion="24" /&gt;
  &lt;application
      android:name=".AnalyticsTracker"
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/MyMaterialTheme"&gt;
      &lt;activity
          android:name="com.example.Login"
          android:configChanges="orientation|keyboardHidden"
          android:label="@string/app_name"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  
      &lt;service
          android:exported="false"
          android:name=".FirebaseMessage"&gt;
  
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.firebase.MESSAGING_EVENT"/&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
      &lt;service
          android:exported="false"
          android:name=".FirebaseInstanceID"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.firebase.INSTANCE_ID_EVENT"/&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TgNOB.jpg" rel="nofollow noreferrer">Running Services</a></p>
  
  <p>Any thoughts what's causing this?
  This "MeasurementBrokerService" leaks a lot of memory in my Application for no reason at all. There was a similar <a href="https://stackoverflow.com/questions/34336751/service-measurementbrokerservice-is-in-use-is-showing-in-my-application-proces">post</a> but no solution was found.</p>
  
  <p>I run the latest Google Play Services so nothing is outdated </p>
  
  <p><strong>UPDATED</strong> i got the \app\build\intermediates\manifests\full\debug\AndroidManifest.xml</p>
  
  <p>It contains quite a lot "services" and declares, more than the AndroidManifest.xml in the android studio.</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.web"
  android:versionCode="26"
  android:versionName="1.2.60" &gt;
  
  &lt;uses-sdk
      android:minSdkVersion="15"
      android:targetSdkVersion="24" /&gt;
  
  &lt;supports-screens
      android:anyDensity="true"
      android:largeScreens="true"
      android:normalScreens="true"
      android:smallScreens="true"
      android:xlargeScreens="true" /&gt;
  
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
  
  &lt;permission
      android:name="com.example.web.permission.C2D_MESSAGE"
      android:protectionLevel="signature" /&gt;
  
  &lt;uses-permission android:name="com.example.web.permission.C2D_MESSAGE" /&gt;
  
  &lt;application
      android:name="com.example.web.AnalyticsTracker"
      android:allowBackup="true"
      android:icon="@drawable/ic_launcher"
      android:label="@string/app_name"
      android:theme="@style/MyMaterialTheme" &gt;
      &lt;meta-data
          android:name="com.samsung.android.sdk.multiwindow.enable"
          android:value="true" /&gt;
      &lt;meta-data
          android:name="com.samsung.android.sdk.multiwindow.multiinstance.enable"
          android:value="false" /&gt;
      &lt;meta-data
          android:name="com.sec.android.multiwindow.STYLE"
          android:value="fixedRatio" /&gt;
      &lt;meta-data
          android:name="com.sec.android.support.multiwindow"
          android:value="true" /&gt;
  
      &lt;activity
          android:name="com.example.web.MainActivity"
          android:configChanges="orientation|keyboardHidden"
          android:label="@string/app_name" /&gt;
      &lt;activity
          android:name="com.example.web.Login"
          android:configChanges="orientation|keyboardHidden"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
  
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  
      &lt;service
          android:name="com.example.web.FirebaseMessage"
          android:exported="false" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
             
      &lt;receiver android:name="com.example.web.Autostart" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
              &lt;action android:name="android.intent.action.QUICKBOOT_POWERON" /&gt;
              &lt;action android:name="android.net.conn.CONNECTIVITY_CHANGE" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
      &lt;service
          android:name="com.fexample.web.FirebaseInstanceID"
          android:exported="false" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.firebase.INSTANCE_ID_EVENT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
      &lt;activity
          android:name="com.google.android.gms.common.api.GoogleApiActivity"
          android:exported="false"
          android:theme="@android:style/Theme.Translucent.NoTitleBar" /&gt;
  
      &lt;meta-data
          android:name="com.google.android.gms.version"
          android:value="@integer/google_play_services_version" /&gt;
  
      &lt;service
          android:name="com.google.firebase.messaging.FirebaseMessagingService"
          android:exported="true" &gt;
          &lt;intent-filter android:priority="-500" &gt;
              &lt;action android:name="com.google.firebase.MESSAGING_EVENT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
  
      &lt;receiver
          android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
          android:exported="true"
          android:permission="com.google.android.c2dm.permission.SEND" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
              &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
  
              &lt;category android:name="com.example.web" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
      &lt;receiver
          android:name="com.google.firebase.iid.FirebaseInstanceIdInternalReceiver"
          android:exported="false" /&gt;
  
      &lt;service
          android:name="com.google.firebase.iid.FirebaseInstanceIdService"
          android:exported="true" &gt;
          &lt;intent-filter android:priority="-500" &gt;
              &lt;action android:name="com.google.firebase.INSTANCE_ID_EVENT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/service&gt;
  
      &lt;provider
          android:name="com.google.firebase.provider.FirebaseInitProvider"
          android:authorities="com.example.web.firebaseinitprovider"
          android:exported="false"
          android:initOrder="100" /&gt;
  
      &lt;service
          android:name="com.google.firebase.crash.internal.service.FirebaseCrashReceiverService"
          android:process=":background_crash" /&gt;
      &lt;service
          android:name="com.google.firebase.crash.internal.service.FirebaseCrashSenderService"
          android:process=":background_crash" /&gt;
  
      &lt;receiver
          android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
          android:enabled="true" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.gms.measurement.UPLOAD" /&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  
      &lt;service
          android:name="com.google.android.gms.measurement.AppMeasurementService"
          android:enabled="true"
          android:exported="false" /&gt;
  
      &lt;activity
          android:name="com.google.android.gms.appinvite.PreviewActivity"
          android:exported="true"
          android:theme="@style/Theme.AppInvite.Preview" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="com.google.android.gms.appinvite.ACTION_PREVIEW" /&gt;
  
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name="com.google.android.gms.ads.AdActivity"
          android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
          android:theme="@android:style/Theme.Translucent" /&gt;
      &lt;activity
          android:name="com.google.android.gms.ads.purchase.InAppPurchaseActivity"
          android:theme="@style/Theme.IAPTheme" /&gt;
      &lt;activity
          android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity"
          android:excludeFromRecents="true"
          android:exported="false"
          android:theme="@android:style/Theme.Translucent.NoTitleBar" /&gt;
  
      &lt;service
          android:name="com.google.android.gms.auth.api.signin.RevocationBoundService"
          android:exported="true"
          android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" /&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p></p>