title: Cannot resolve symbol 'AppCompatActivity' , Cannot resolve symbol 'R', Could not download support-compat.aar
body: <p>I installed Android Studio 2.1.3, and successfully created a new project (just call it ProA), it runs well in AVD. That time I had just only downloaded the SDK platform android-24. I created that project with the Minimum SDK API 14. Actually , I didn't download android-14 at that time.<br>
  Then later I downloaded android-14, android-15,android-21,android-23, tried to create a new project (call it ProB), but many errors occurred there.  </p>
  
  <ol>
  <li><p>The <code>MainActivity</code>'s superclass is <code>AppCompatActivity</code> , but the error is <code>Cannot solve symbol 'AppCompatActivity'</code>.  </p></li>
  <li><p>There is a red line under the <code>@Override</code> tag over the <code>onCreate()</code> method, saying that <code>Method does not override a method from its superclass</code>  </p></li>
  <li><p>In <code>onCreate()</code> method ,the <code>setContentView(R.layout.activity_main)</code> code snippet shows <code>Cannot resolve symbol 'R'</code>.  </p></li>
  <li>The Messages window has a error message saying<br>
  <code>A problem occurred configuring project ':app'.<br>
  Could not download support-compat.aar(com.android.support:-compat:24.2.0): No cached version available for offline mode</code></li>
  </ol>
  
  <p>the overall picture is like this: <a href="https://i.stack.imgur.com/DYHNy.png" rel="nofollow noreferrer">the overall error image(click to see)</a></p>
  
  <p>the content of app\src\build.gradle:  </p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 24
      buildToolsVersion "24.0.1"
  
      defaultConfig {
          applicationId "com.example.zhangsir.aftervpn"
          minSdkVersion 14
          targetSdkVersion 24
          versionCode 1
          versionName "1.0"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  }
  
  dependencies {
      compile fileTree(dir: 'libs', include: ['*.jar'])
      testCompile 'junit:junit:4.12'
      compile 'com.android.support:appcompat-v7:24.2.0'
  }
  </code></pre>
  
  <p>the content of gradle\build.gradle:  </p>
  
  <pre><code>// Top-level build file where you can add configuration options common to all sub-projects/modules.
  
  buildscript {
      repositories {
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:2.1.3'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
      }
  }
  
  allprojects {
      repositories {
          jcenter()
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <h2><a href="https://i.stack.imgur.com/FNgrL.png" rel="nofollow noreferrer">the screenshot of the standalone sdk manager (click to see)</a></h2>
  
  <hr>
  
  modified at 2016 Aug,27
  
  <p>I have downloaded all the Android SDK Build-tools:<a href="https://i.stack.imgur.com/KB6HQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KB6HQ.png" alt="Android SDK Build-tools"></a></p>
  
  <hr>
  
  <p>What can I do to solve this problem?</p>