Gradle:Using flatDir should be avoided because it doesn‘t support any meta-data formats.

app.gradle

Code snippet 1:

repositories {
    flatDir {
        dirs 'libs'
    }
}

Code snippet 2:

dependencies {
    classpath "com.android.tools.build:gradle:4.2.2"
}

After gradle is upgraded to 4.2.2, the following prompt message will appear during compilation. Delete & lt; Code snippet 1 & gt; The problem can be solved

Using flatDir should be avoided because it doesn’t support any meta-data formats.
Affected Modules: APP

Use the LIBS directory if necessary

        Add the following code to the project module.gradle

android {
    
    ...

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
}

Problem solving.

Read More: