By launching the Gradle plugin 3.0 (Android Studio 3.0), the command has compile
been replaced by api
and implementation
. This explains https://blog.mindorks.com/implementation-vs-api-in-gradle-3-0-494c817a6fa
However, for a clean Kotlin module, as shown below, I cannot use api
. that is, the code below will have an error while synchronizing
apply plugin: 'kotlin'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
Error
Could not find method api() for arguments [org.jetbrains.kotlin:kotlin-stdlib-jre7:1.1.2-4]
on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. Open File`
Instead, I should use "deprecated compile
. "
Why is support api
supported in a clean kotlin
module?
source
share