I'm seeing the following warning when building in Android Studio:
Using flatDirs should be avoided because it doesn't support any meta-data formats
I'm integrating with an aar that is packaged locally in my libs
directory. Is there another way to integrate without adding the following problematic block to my build.gradle
?
repositories {
flatDir {
dirs 'libs'
}
}
repositories { flatDir { dirs("lib") } flatDir { dirs("lib1", "lib2") } } This adds repositories which look into one or more directories for finding dependencies. This type of repository does not support any meta-data formats like Ivy XML or Maven POM files.
The dependencyResolutionManagement repositories block accepts the same notations as in a project, which includes Maven or Ivy repositories, with or without credentials, etc. By default, repositories declared by a project will override whatever is declared in settings.
In the command prompt, enter Gradle -version. It will display the current version of Gradle just installed on the screen.
Add following piece of code in android block:
android { ..
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
and add dependency as:
implementation (files("libs/test_name.aar"))
delete following block:
repositories {
flatDir {
dirs 'libs'
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With