title: Cannot access ActivityCompatApi23 class
body: <p>I am having runtime problems with my gradle file. I added this <code>compile 'com.google.android:flexbox:0.3.1'</code> as a compile time dependency to my Gradle file. I encountered an error and added this in my project level Gradle file.</p>
  
  <pre><code>maven {
              url "https://maven.google.com"
          }
  </code></pre>
  
  <p>Which finally looked liked this after adding the above</p>
  
  <pre><code>allprojects {
      repositories {
          jcenter()
          maven {
              url "https://maven.google.com"
          }
      }
  }
  </code></pre>
  
  <p>After adding the above in my app level Gradle file I am now encountering a different error when I am trying to run my app. So I did the following as per some answers from SO.</p>
  
  <ol>
  <li>Tried a Clean and Rebuild.</li>
  <li><p>Navigated to the path <code>projectName\.idea\libraries</code> and deleted the files that contained the support library version other than the current versions <code>25.3.1</code>
  3.In order to solve the error I further removed this line from my app level Gradle file,</p>
  
  <p>androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
          exclude group: 'com.android.support', module: 'support-annotations'
      })</p></li>
  </ol>
  
  <p>Now the final Gradle file looks like this with the error,</p>
  
  <p>Error: </p>
  
  <pre><code>Error:(28, 8) error: cannot access ActivityCompatApi23
  class file for android.support.v4.app.ActivityCompatApi23 not found
  </code></pre>
  
  <p>My Gradle file</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 25
      buildToolsVersion "25.0.3"
      defaultConfig {
          applicationId "com.example.test"
          minSdkVersion 19
          targetSdkVersion 25
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
          vectorDrawables.useSupportLibrary = true
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
  
      compile 'com.android.support:appcompat-v7:25.3.1'
      compile 'com.android.support:design:25.3.1'
      compile 'com.android.support:cardview-v7:25.3.1'
      compile 'com.android.support:support-v4:25.3.1'
      compile 'com.google.android:flexbox:0.3.1'
      compile 'uk.co.chrisjenx:calligraphy:2.3.0'
      testCompile 'junit:junit:4.12'
  }
  </code></pre>