Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 236
morajabi Avatar asked Sep 20 '15 05:09

morajabi


People also ask

What are tools attributes in Android Studio?

Tools attributes reference. Android Studio supports a variety of XML attributes in the tools namespace that enable design-time features (such as which layout to show in a fragment) or compile-time behaviors (such as which shrinking mode to apply to your XML resources).

How to fix unknown_JVMTI_error error in Android Studio?

JVMTI error: UNKNOWN_JVMTI_ERROR To work around this issue in Android Studio 3.5, click Run to re-deploy your app and see your changes. Note: This issue ( #135172147) is fixed in Android Studio 3.6 Canary 6 and higher.

Can listview attributes be used in Android Studio?

Note: These attributes don't work for ListView in Android Studio 2.2, but this is fixed in 2.3 ( issue 215172 ). Intended for: Any root <View> in a layout that's referred to by an <include>

How to force Android Studio to ignore missing content description?

For example, you can force the Android Studio to ignore missing content description of <ImageView>: tools:targetApi — intended for any element and used to indicate the API level (either as an integer or as a code name) that supports this element.


2 Answers

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!

like image 191
Tom Larcher Avatar answered Oct 18 '22 03:10

Tom Larcher


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

like image 31
Pronoy999 Avatar answered Oct 18 '22 04:10

Pronoy999