leon
leon

Reputation: 560

Android Studio 3.1 can not resolve "Theme.AppCompat" styles properly

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'

Upvotes: 4

Views: 2567

Answers (2)

Aba
Aba

Reputation: 2387

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

Upvotes: 1

Aba
Aba

Reputation: 2387

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

Upvotes: 18

Related Questions