morajabi
morajabi

Reputation: 121

Android Studio layout Error : Unknown attribute

Android Studio Code Completion seems not working on xml and also it doesn't recognize any xml attribute except the attrs on Android support v7 views. Screenshot:

enter image description here

my views that is from android.support.design.v7 display correctly:

enter image description here

Upvotes: 5

Views: 5815

Answers (2)

Tom Larcher
Tom Larcher

Reputation: 951

I had this issue for a while and tried all the "solutions" provided;

  • Sync Gradle files.
  • Invalidate cache.
  • Removed and re-add project.
  • Reinstall Android Studio.

Nothing worked, until I came across this answer (by 4gus71n) which has worked for me every time this rather rare, but annoying issue has presented itself: https://stackoverflow.com/a/53160674/5692877

In my case I;

  1. Closed Android Studio.
  2. Cleared the contents of the C:\Users\MyUsername\.AndroidStudio3.2\system\caches\ directory.
  3. Relaunched Android Studio.

Worked a treat!

Upvotes: 8

Pronoy999
Pronoy999

Reputation: 660

If you are Android Studio then go to tools and then Android then click on build with gradle, it will solve the error. I encountered it too.

Tools->Android->Build with Gradle

Upvotes: 2

Related Questions