Ashraf Alshahawy
Ashraf Alshahawy

Reputation: 1189

Unknow attributes in xml files after migrating to Androidx

I migrated to AndroidX via Refactor - Migrate to AndroidX

Now Android Studio highlights most attributes in the layouts files as Unknown

I abbreviated the code below to show only some of the unknown attributes

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:fitsSystemWindows="true" (Unknown)
    android:clipToPadding="true" (Unknown)
    android:scrollbars="none" (Unknown)

<LinearLayout
    android:paddingTop="20dp" (Unknown)
    android:paddingBottom="20dp" (Unknown)

    <TextView
        android:layout_marginTop="20dp" (Unknown)
        android:paddingStart="20dp" (Unknown)
        android:paddingEnd="20dp" (Unknown)
        android:text="Some Text" (Unknown)

In gradle.properties I have

android.enableJetifier=true
android.useAndroidX=true

In build.gradle

android {
    compileSdkVersion 29
    buildToolsVersion '29.0.2'
    defaultConfig {

        minSdkVersion 21
        targetSdkVersion 29

I tried

Nothing worked

Upvotes: 1

Views: 352

Answers (2)

Zain
Zain

Reputation: 40830

Please try to clean below cache folders to give a change to re-download libraries

c:\Users\<user>\.gradle\caches\
c:\Users\<user>\.AndroidStudio3.x\system\caches\

Sources: 1, 2

Upvotes: 1

AnonRocketman
AnonRocketman

Reputation: 188

Had the same problem some days back; Cleaning the C:\Users.AndroidStudio3.2\system\caches also did not worke for me. Fixed it with completly reinstalling Android Studio.

Upvotes: 0

Related Questions