Unknown attribute android
Asked Answered
M

2

24

enter image description here

Getting Unknown attribute error on all android tag.

In layout XML, Auto suggestion is not showing all attributes (like layout_width, layout_height, orientation, orientation & all others android attributes.)

Things i have done to resolve this issue.

Clean Build & Rebuild Deleted .idea file Invalidated Caches/ Restart.. option Turn On Power Save Mode. SDk is up to date.

Unknown attribute android:orientation less. (Ctrl+F1) This inspection highlights unknown XML attributes in Android resource files and AndroidManifest.xml

currently using :

 Android studio 3.2.1
 targetSdkVersion 27
 ext.kotlin_version = '1.2.61'
 build:gradle:3.2.1

I tried with deleting .idea in the path and invalidate cache and restart ,synching the gradle

Miscreance answered 17/10, 2018 at 11:48 Comment(9)
Have you check if you have a correct AndroidManifest.xml xml structure?Diacetylmorphine
yes i checked with all posiibilitiesMiscreance
Try checking if Android plugins is enabled in your setting.Diacetylmorphine
yeah checked,its already enabledMiscreance
Try moving your project to a path which doesn't have a space (` `) in it.Diacetylmorphine
i got a solution by uninstalling adroid studio and changing the sdk pathMiscreance
Can you post the build output where the error is displayed? Your screenshot is not of great use without thatDecided
while building it will not show anything,after that in XML Getting Unknown attribute error on all android tag.Miscreance
Possible duplicate of Unknown attribute android:layout_width, layout_height, id, gravity, layout_gravity, paddingAllahabad
P
43

got the same issue recently with Windows7 and Android studio 3.2.1. what's actually helped is clean up of the following folders:

c:\Users\<user>\.gradle\caches\
c:\Users\<user>\.AndroidStudio3.2\system\caches\
Phelgon answered 29/10, 2018 at 20:36 Comment(6)
it was solution in my case, before this I tried all possible ways but nothing helpedBartz
and one more thing,delete the wrapper gradle-version-all and again rebuild the application..Miscreance
It works. In the end, I just need to sync gradle with project and click the hammer button.Ushijima
This is the only solution that's worked for me. Thank you!Croton
Yes, this should be marked as right & accepted answer among all others answers for this issue on S.O.Umont
Where can we find the folders in Linux distribution?Toby
W
1

100% Working

These two steps will solve.

Do this two steps: 1.Go to folder where you android studio caches are located. I have android studio 3.6.3 For me it's "C:\Users\Lenovo.AndroidStudio3.6\system\caches" 2.Go to the folder where you android studio projects are located. Open the project >then .idea folder and delete the caches. For me its "C:\Users\Lenovo\AndroidStudioProjects\MyDictionary.idea\caches"

Warlike answered 14/7, 2020 at 5:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.