Does anyone know how to include implementation...
# android
a
Does anyone know how to include implementation fileTree(dir: 'libs', include: ['*.aar']) in Deps.kt file
g
include dependency to Deps.kt? What it mean?
Or you mean just declare
fileTree(dir: 'libs', include: ['*.aar'])
?
Copy code
val localLibs = fileTree(mapOf("dir" to "libs", "include" to listOf("*.aar")))
w
You need reference to the
Project
instance in order to create
fileTree
. So there are many options, really:
You could declare
localLibs
as function and apply it in the project:
Copy code
Deps.kt:
val localLibs = { project: Project ->
    project.fileTree(dir: 'libs', include: ['*.aar'])
}

project build.gradle:
implementation(Deps.localLibs(project))
a
got it thanks alot
whtas it import for Project
its not recognised
w
org.gradle.api.Project
a
its giving this error
w
Right, at first I thought you were asking about groovy for some reason
a
nope
w
Andrey pasted proper syntax for fileTree function in Kotlin
a
ok but how to mention it in dependencies.gradle file
w
You’re not really providing enough details to be able to help you. Perhaps this problem is better suited for stackoverflow