title: What is AppMeasurementService and why does Android Studio add this service to my app?
body: <p>I've recently started designing an app with Android studio and it seems Android Studio is adding things to my manifest without my knowledge.</p>
  
  <p>For example it has added a service:<br>
  <code>com.google.android.gms.measurement.AppMeasurementService</code></p>
  
  <p>that I have no idea why it's there. And it also adds permissions such as:<br></p>
  
  <pre><code>com.google.android.c2dmpermission.RECEIVE
  android.permission.USE_CREDENTIALS
  </code></pre>
  
  <p>This increases the size and memory consumption of my app so I want to get rid of it but I haven't figured out how.</p>
  
  <p>Thought it maybe was in the "Project Structure" menu item in Android but can't find anywhere to turn it off. All the Developers Services are turned off (even though Analytics seem to have been activt by default but I turned it off).</p>
  
  <p>Would appreciate any pointers to how I can remove all this automatically added stuff?</p>
  
  <p>Thanks</p>
  
  <p>Edit:
  After further investigation it turns out that my AndrodManifest.xml in the</p>
  
  <pre><code>  build\intermediates\manifests\full\release 
  </code></pre>
  
  <p>directory contains a lot of additional information:</p>
  
  <pre><code>    &lt;!-- Include the AdActivity and InAppPurchaseActivity configChanges and themes. --&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;meta-data
          android:name="com.google.android.gms.version"
          android:value="@integer/google_play_services_version" /&gt;
  
      &lt;provider
          android:name="com.google.android.gms.measurement.AppMeasurementContentProvider"
          android:authorities="net.stefano.stefanoface.google_measurement_service"
          android:exported="false" /&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;meta-data
          android:name="com.google.android.wearable.beta.app"
          android:resource="@xml/android_wear_micro_apk" /&gt;
  </code></pre>
  
  <p>It seems AdActivity and InAppPurchaseActivity is automatically added but all developer servics are turned off in the "Project Structure". Why is this there anyway?</p>
  
  <p>The build.gradle file:</p>
  
  <pre><code>     compileSdkVersion 22
       buildToolsVersion "22.0.1"
      defaultConfig {
          applicationId "net.stefano.stefanoface"
          minSdkVersion 18
          targetSdkVersion 22
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      productFlavors {
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      wearApp project(':wear')
      compile 'com.android.support:appcompat-v7:22.2.1'
      compile 'com.google.android.gms:play-services:8.1.0'
      compile 'com.android.support:design:22.2.1'
      compile 'com.google.android.gms:play-services-base:7.5.0'
  }
  </code></pre>
  
  <p>Yes, I'm developing a wear app so I do need access to Google Play Services but only the Wear part.</p>
  
  <p>Thanks</p>