4

Last night, I upgrade my android studio from 3.0.1 to 3.1, and rebuild my project, and I got the error as show below.

enter image description here

CHECKED LIST:

  1. compileSdkVersion 27

  2. buildToolsVersion '27.0.3'

  3. classpath 'com.android.tools.build:gradle:3.1.0'

  4. implementation 'com.android.support:appcompat-v7:27.1.0'

  5. implementation 'com.android.support:design:27.1.0'

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
leon
  • 550
  • 6
  • 14
  • Possible duplicate of [Android Studio 3.1 Cannot Resolve Symbol (Themes, Widget, attr, etc.)](https://stackoverflow.com/questions/49523302/android-studio-3-1-cannot-resolve-symbol-themes-widget-attr-etc) – Nerdy Bunz Mar 29 '18 at 02:55
  • @BooberBunz thanks for your quickly response, and I checked all comments and not worked for me. – leon Mar 29 '18 at 03:06

2 Answers2

18

As mentioned in this question:

  1. Close project.
  2. Remove it from the projects list (left side in the default Android Studio window).
  3. Open existing project -> choose the project folder.

Basically, close & re-open the project.. worked for me (after even invalidating cache didn't work).

Related issues from issuetracker: 77211616, 77938563, 73536373

Aba
  • 2,307
  • 2
  • 18
  • 32
1

Even though my first answer works, it's actually a hassle because the issue keeps on reoccurring, especially after I switch branches (for different development or code reviews). So, I read further and found this answer:

Switch your support lib version - either to a newer ver (27.1.1 stable as of now), or to an older version & back to current.

It's an alternative and seems to work.

Related issues from issuetracker: 77211616, 77938563, 73536373

Aba
  • 2,307
  • 2
  • 18
  • 32