title: Android Studio Rendering Problems: android.support.v4.view.ViewPager not found
body: <p>I have an XML layout containing <code>android.support.v4.view.ViewPager</code>.</p>
  <p>The app works great when I run it, but the layout preview in Android Studio is unable to render this View, and shows the following error:</p>
  <blockquote>
  <p>Rendering Problems The following classes could not be found:</p>
  <p>- android.support.v4.view.ViewPager (Fix Build Path, Create Class)</p>
  <p>Tip: Try to build the project.</p>
  </blockquote>
  <p>I have the following lines in <code>build.gradle</code>:</p>
  <pre><code>dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      compile 'com.android.support:appcompat-v7:20.0.0'
  }
  </code></pre>
  <p>I have also tried adding <code>compile 'com.android.support:support-v4:20.0.0'</code>, although some people seem to suggest that this is not needed since it is included in appcompat-v7. I am inclined to agree since the app works without it.</p>
  <p>I have tried cleaning and rebuilding the project.</p>