Plain Kotlin module in Android Studio 3.0, `api` is not supported?

By launching the Gradle plugin 3.0 (Android Studio 3.0), the command has compilebeen replaced by apiand 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 apisupported in a clean kotlinmodule?

+4
source share
1 answer

compile Gradle, , Android Java Library. Java . Kotlin. , (, , , Java).

+6

Source: https://habr.com/ru/post/1687992/


All Articles