title: Android Studio - 'Cannot resolve symbol' syntax highlighting errors although build is ok
body: <p>I have a really annoying problem since several days, after I tried to restore a previously working Android Studio project from a backup, after getting a new computer.</p>
  <p>I have the <strong>&quot;cannot resolve symbol&quot;</strong> syntax highlighting problem with the classes from Android libraries such as <code>android.support.v7.app</code>, <code>android.support.v4.app</code>, and Google Play Services, which I have included as dependencies.
  But, the project builds fine and I can run the App on phone with no problems.</p>
  <p>I have verified whether these jar files exist under SDK installation - for e.g. &quot;\sdk\extras\android\m2repository\com\android\support\appcompat-v7\23.0.1&quot;.</p>
  <p>My problem is quite similar to the ones reported in below posts:</p>
  <ol>
  <li><a href="https://stackoverflow.com/questions/19508649/android-studio-says-cannot-resolve-symbol-but-project-compiles">Android Studio says &quot;cannot resolve symbol&quot; but project compiles</a></li>
  <li><a href="https://stackoverflow.com/questions/18991161/android-studio-cannot-resolve-symbol-but-code-executes-correctly?lq=1">Android Studio cannot resolve symbol but code executes correctly</a></li>
  <li><a href="https://stackoverflow.com/questions/21100688/android-studio-suddenly-cannot-resolve-symbols?lq=1">Android Studio suddenly cannot resolve symbols</a></li>
  </ol>
  <p>I have tried all the solutions provided in various stackoverflow discussions (i.e. Sync Gradle Project, Invalidate Cache/Restart, Clean/Rebuild, Deleting gradle generated files (.gradle, build, .idea directories etc.), downgrade to lower API and upgrade etc. But, no method is helpful.</p>
  <p>I use Android Studio 1.3.2 and API 23. All build tools, support library etc. are up to date (tried with both v22.+ and v23.+ of the libraries).</p>
  <p>Please do help if you have any other suggestions!</p>
  <p>Extract from my build.gradle:</p>
  <pre><code>apply plugin: 'com.android.application'
  android {
          compileSdkVersion 22
          buildToolsVersion '23.0.1'
  
  defaultConfig {
      applicationId &quot;com.myapp.fun&quot;
      minSdkVersion 22
      targetSdkVersion 23
      versionCode 1
      versionName &quot;1.0&quot;
  }
  buildTypes {
      release {
          minifyEnabled false
          proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
      }
  }
  }
  dependencies {
      compile fileTree(include: ['*.jar'], dir: 'libs')
      compile 'com.android.support:support-v4:22.+'
      compile 'com.android.support:appcompat-v7:22.+'
  }
  </code></pre>
  <p>Screenshots of the problems can also be found below. I think Android Studio is not able to import the dependent libraries for syntax highlighting, although the compiler is able to include them and build successfully.</p>
  <p><strong>Screenshot</strong>: <a href="https://i.stack.imgur.com/4qYV3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4qYV3.png" alt="Syntax highlight and auto-complete issue" /></a></p>