title: The meta-data tag in your app's AndroidManifest.xml does not have the right value
body: <p>I am running into the issue where Robolectric is having trouble with my AndroidManifest.xml. My app runs fine, but Robolectric is failing all my tests, even <code>assertTrue(true)</code>. The error is:</p>
  
  <pre><code>android.view.InflateException: XML file /[blah]/build/res/all/debug/layout/activity_main.xml line #-1 (sorry, not yet implemented): Error inflating class fragment
  </code></pre>
  
  <p>caused by:</p>
  
  <pre><code>java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value.  Expected 4030500 but found 0.  You must have the following declaration within the &lt;application&gt; element:     &lt;meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /&gt;
  </code></pre>
  
  <p>The problem is that I already have that line in my manifest. Below are some of the relevant files:</p>
  
  <p>AndroidManifest.xml:</p>
  
  <pre><code>&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.bryansills.studywithfriends"
      android:versionCode="1"
      android:versionName="1.0"&gt;
  
      &lt;uses-sdk
          android:minSdkVersion="14"
          android:targetSdkVersion="18"/&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:logo="@drawable/ic_action_icon"
          android:label="@string/app_name"
          android:theme="@style/study"&gt;
  
          &lt;activity
              android:name="com.bryansills.studywithfriends.MainActivity"
              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;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="@string/google_maps_api_key_v2"/&gt;
  
          &lt;meta-data
              android:name="com.google.android.gms.version"
              android:value="@integer/google_play_services_version"/&gt;
      &lt;/application&gt;
  &lt;/manifest&gt;
  </code></pre>
  
  <p>build.gradle:</p>
  
  <pre><code>buildscript {
      repositories {
          mavenCentral()
          maven {
              url 'https://oss.sonatype.org/content/repositories/snapshots/'
          }
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.7.+'
          classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'
      }
  }
  
  apply plugin: 'android'
  apply plugin: 'android-test'
  
  repositories {
      mavenCentral()
      maven {
          url 'https://oss.sonatype.org/content/repositories/snapshots/'
      }
  }
  
  android {
      compileSdkVersion 19
      buildToolsVersion "19.0.0"
  
      defaultConfig {
          minSdkVersion 14
          targetSdkVersion 18
      }
  }
  
  dependencies {
      compile 'com.android.support:support-v4:+'
      compile 'com.google.android.gms:play-services:4.0.+'
  
      testCompile 'junit:junit:4.11'
      testCompile 'org.robolectric:robolectric:2.3-SNAPSHOT'
      testCompile 'com.squareup:fest-android:1.0.+'
  }
  </code></pre>
  
  <p>MainActivityTest.java:</p>
  
  <pre><code>package com.bryansills.studywithfriends;
  
  import android.app.Activity;
  import android.content.Intent;
  import android.graphics.drawable.Drawable;
  import android.support.v4.app.ActionBarDrawerToggle;
  import android.support.v4.widget.DrawerLayout;
  import android.view.ActionProvider;
  import android.view.ContextMenu;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.SubMenu;
  import android.view.View;
  import com.bryansills.studywithfriends.MainActivity;
  import dalvik.annotation.TestTargetClass;
  import org.junit.Test;
  import org.junit.Before;
  import org.junit.runner.RunWith;
  import org.robolectric.Robolectric;
  import org.robolectric.shadows.ShadowToast;
  import org.robolectric.tester.android.view.TestMenuItem;
  import com.bryansills.studywithfriends.RobolectricGradleTestRunner;
  
  import java.lang.*;
  import java.lang.CharSequence;
  import java.lang.Exception;
  import java.lang.Override;
  import java.lang.System;
  
  import static org.junit.Assert.assertTrue;
  
  @RunWith(RobolectricGradleTestRunner.class)
  public class MainActivityTest {
      private MainActivity mainActivity;
      private DrawerLayout drawer;
      private MenuItem settingsMenuItem;
      private MenuItem helpMenuItem;
  
      @Before
      public void setUp() throws Exception {
          mainActivity = Robolectric.buildActivity(MainActivity.class).create().visible().get();
          drawer = (DrawerLayout) mainActivity.findViewById(R.id.drawer);
          settingsMenuItem = new TestMenuItem(R.id.settings);
          helpMenuItem = new TestMenuItem(R.id.help);
      }
  
      @Test
      public void testTrue() throws Exception {
          assertTrue(true);
      }
  
      @Test
      public void testActivity() throws Exception {
          assertTrue(mainActivity != null);
      }
  
      @Test
      public void settingsMenuItemShouldStartSettingsActivity() throws Exception {
          mainActivity.onOptionsItemSelected(settingsMenuItem);
          assertTrue(ShadowToast.getTextOfLatestToast().equals("Settings"));
      }
  
      @Test
      public void helpMenuItemShouldStartSettingsActivity() throws Exception {
          mainActivity.onOptionsItemSelected(helpMenuItem);
          assertTrue(ShadowToast.getTextOfLatestToast().equals("Help"));
      }
  }
  </code></pre>