AndroidManifest and XML layouts are showing me the Unknown attribute android:
warning even though the attributes exist and the app works on the device.
Example: Unknown attribute android:maxSdkVersion
, android:clickable="true"
etc.
I am aware of the other questions regarding this issue and tried everything I could find about this topic but nothing works for me.
I tried to:
Sync Project with Gradle Files
Delete the .idea and .gradle folders from the project location
Delete caches from c:Users<user>.gradlecaches
Invalidate caches and restart …and many other things I couldn’t remember right now.
The problem still persists on a newly installed OS (Windows 11) and obviously, newly installed Android Studio, and also the issue affects only old projects…
Also, my project is up to date with everything the Android Studio doesn’t show me any warning to update a version of a dependency or so.
Gradle version 7.3.3
Android Gradle Plugin Version 7.2.1
Update:
The warning appears only with the SDK version 33 (compileSdkVersion 33
), if I build with version 32, the warning disappears…
Update2:
New projects which use API level 33 still show the warning…
Maybe it’s a bug in the SDK?
5
Answers
Same here, I use this temporary workaround until Android team fix this issue or better solution.
It’s not ideal, but switching to Dolphin RC1 resolves this. Given that it will (presumably) hit stable pretty soon, it may not get fixed in Chipmunk. You can download Dolphin from the Android Studio Preview page, just be aware that it is not available as an installer so you will need to manually update your installed version or use it alongside until it hits stable.
UPD 20.01.2023: You can update Android Studio to the latest version now (Android Studio Electric Eel | 2022.1.1) and this bug is fixed there. Worked for me.
OLD: Got same crap and a lot of other.
And yes, just downgraded
buildToolsVersion
to "32.1.0 rc1" andtargetSdkVersion
,compileSdkVersion
to API 32 for as long as bug exists in API 33.Perfect!!
set compileSdkVersion to 32
set targetSdkVersion to 32
downgrade androidx.core:core-ktx
This config works for me: